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

Bypass errors during run.Experiment __del__ #10

Merged
merged 2 commits into from
Aug 26, 2024
Merged

Conversation

hemildesai
Copy link
Collaborator

No description provided.

@hemildesai hemildesai requested a review from Kipok August 26, 2024 20:42
Kipok
Kipok previously approved these changes Aug 26, 2024
Copy link
Collaborator

@Kipok Kipok left a comment

Choose a reason for hiding this comment

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

Thanks! Just wondering why is that logic needed and also what are the cases when it might fail (and we should still ignore that)?

src/nemo_run/run/experiment.py Outdated Show resolved Hide resolved
@hemildesai
Copy link
Collaborator Author

Thanks! Just wondering why is that logic needed and also what are the cases when it might fail (and we should still ignore that)?

The __del__ method just does some cleanup like removing existing ssh tunnels etc whenever the Experiment object is garbage collected. But some objects are garbage collected before the Experiment which leads to the exceptions. So I think it's pretty safe to have the try...except in del but not in cleanup (as cleanup is called in other places too).

Co-authored-by: Igor Gitman <[email protected]>
Signed-off-by: Hemil Desai <[email protected]>
Signed-off-by: Hemil Desai <[email protected]>
try:
deconfigure_logging()
self._cleanup()
except Exception:

Check notice

Code scanning / CodeQL

Empty except Note

'except' clause does nothing but pass and there is no explanatory comment.
@hemildesai hemildesai merged commit 3a869e6 into main Aug 26, 2024
7 checks passed
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.

2 participants