Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[batch] Don't rmtree if any errors occur while unmounting #12985

Merged
merged 5 commits into from
May 4, 2023

Conversation

jigold
Copy link
Contributor

@jigold jigold commented May 4, 2023

I think this change is better than #12975

@jigold
Copy link
Contributor Author

jigold commented May 4, 2023

It would be great in a separate PR to check for sure there aren't any zombie fuse mounts before removing files.

danking
danking previously requested changes May 4, 2023
except asyncio.CancelledError:
raise
except Exception:
log.exception(f'error while unmounting cloudfuse for {self.jvm_name} for job {self.id}')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's include the same information we have above:

Suggested change
log.exception(f'error while unmounting cloudfuse for {self.jvm_name} for job {self.id}')
log.exception(
f'while unmounting fuse blob storage {bucket} from {mount_path} for {self.jvm_name} for job {self.id}'
)

except IncompleteJVMCleanupError:
assert isinstance(job, JVMJob)
await self.recreate_jvm(job.jvm)
log.exception(f'while running {job}, incomplete cleanup from {job.jvm}')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This results in two exceptional logs for a single exception. Let's either not log here or not log near the raise.

raise IncompleteJVMCleanupError
raise IncompleteJVMCleanupError(
f'while unmounting fuse blob storage {bucket} from {mount_path} for {self.jvm_name} for job {self.id}'
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name the exception and add a from e so that we get the fulls tack trace in the log.exception later.

Copy link
Contributor

@danking danking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x

danking
danking previously requested changes May 4, 2023
@@ -2312,6 +2320,11 @@ class JVMCreationError(Exception):
pass


class IncompleteJVMCleanupError(Exception):
def __init__(self, msg):
self.msg = msg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't necessary:

In [1]: class IncompleteJVMCleanupError(Exception):
   ...:     pass
   ...: 

In [2]: raise IncompleteJVMCleanupError('foo')
---------------------------------------------------------------------------
IncompleteJVMCleanupError                 Traceback (most recent call last)
<ipython-input-2-a8a0c94b0ce4> in <cell line: 1>()
----> 1 raise IncompleteJVMCleanupError('foo')

IncompleteJVMCleanupError: foo

@daniel-goldstein
Copy link
Contributor

These changes look great

Copy link
Contributor

@danking danking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

assert isinstance(job, JVMJob)
await self.recreate_jvm(job.jvm)
log.exception(e.msg)
log.exception(f'while running {job}, ignoring')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danking Can you double check the actual exception message will appear in the logs here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danking danking merged commit 78ee77e into hail-is:main May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants