-
Notifications
You must be signed in to change notification settings - Fork 448
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
Capture KeyboardInterrupt during the session launching and cleanup re… #162
Conversation
python/graphscope/client/utils.py
Outdated
"""Context Manager for capture keyboard interrupt | ||
|
||
Args: | ||
func: function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
naming: func
-> callback
or deleter
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
python/graphscope/client/utils.py
Outdated
return self | ||
|
||
def __exit__(self, exc_type, exc_value, exc_tb): | ||
if exc_type is KeyboardInterrupt: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise we don't need such cleanup?
I remember that if the connect
throws exceptions the kubernetes namespace won't be correctly (though I doesn't remember it clearly).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great suggestion. I have captured all exceptions here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Codecov Report
@@ Coverage Diff @@
## main #162 +/- ##
===========================================
- Coverage 78.81% 66.03% -12.79%
===========================================
Files 52 51 -1
Lines 4583 4401 -182
===========================================
- Hits 3612 2906 -706
- Misses 971 1495 +524
Continue to review full report at Codecov.
|
What do these changes do?
Fixes #160 by capture and handle the KeyboardInterrupt during the session launching.
Related issue number
Fixes #160