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

Capture KeyboardInterrupt during the session launching and cleanup re… #162

Merged
merged 4 commits into from
Feb 24, 2021

Conversation

lidongze0629
Copy link
Collaborator

What do these changes do?

Fixes #160 by capture and handle the KeyboardInterrupt during the session launching.

Related issue number

Fixes #160

"""Context Manager for capture keyboard interrupt

Args:
func: function
Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

return self

def __exit__(self, exc_type, exc_value, exc_tb):
if exc_type is KeyboardInterrupt:
Copy link
Collaborator

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).

Copy link
Collaborator Author

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.

Copy link
Collaborator

@sighingnow sighingnow left a comment

Choose a reason for hiding this comment

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

LGTM.

@codecov-io
Copy link

Codecov Report

Merging #162 (c7729b0) into main (954f8a6) will decrease coverage by 12.78%.
The diff coverage is 75.00%.

Impacted file tree graph

@@             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     
Impacted Files Coverage Δ
python/graphscope/client/utils.py 88.33% <66.66%> (-7.75%) ⬇️
python/graphscope/client/rpc.py 65.60% <100.00%> (-18.23%) ⬇️
python/graphscope/client/session.py 64.76% <100.00%> (-8.01%) ⬇️
python/graphscope/interactive/__init__.py 0.00% <0.00%> (-100.00%) ⬇️
python/graphscope/interactive/query.py 0.00% <0.00%> (-94.65%) ⬇️
python/graphscope/deploy/kubernetes/utils.py 12.43% <0.00%> (-61.14%) ⬇️
python/graphscope/deploy/kubernetes/cluster.py 23.80% <0.00%> (-57.94%) ⬇️
...n/graphscope/deploy/kubernetes/resource_builder.py 27.95% <0.00%> (-34.30%) ⬇️
python/graphscope/analytical/app/triangles.py 80.00% <0.00%> (-20.00%) ⬇️
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 954f8a6...c7729b0. Read the comment docs.

@lidongze0629 lidongze0629 merged commit f643d9f into alibaba:main Feb 24, 2021
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.

[BUG] Session still running on the backend when the ctrl-c signal received
3 participants