-
-
Notifications
You must be signed in to change notification settings - Fork 719
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
if there's an exception in the Client async context manager body then close fast #6920
Merged
graingert
merged 5 commits into
dask:main
from
graingert:fast-close-in-client-aexit-on-error
Nov 2, 2022
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
82a724f
if there's an exception in the Client cmgr body then close fast
graingert d6f6561
test that client fast closes on aexit
graingert e510a7c
document _close=Fast as a forcefull close
graingert 954d9e3
demote trio link to a comment
graingert fbf31d2
Merge remote-tracking branch 'origin/main' into pr/graingert/6920
fjetter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I couldn't find any tests that tested what
_close(fast=True)
does:it just reduces this 2 second timeout to 0 (I think fast=True should be quite a bit more aggressive, eg force close rpc etc)
distributed/distributed/client.py
Line 1584 in c373746
so that's why I used a spy 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.
nit: Would you mind incorporating a description of what closing fast means into the docstring for
_close
? I was wondering the same thing when I started reading this PR.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.
introduced here https://github.com/dask/distributed/pull/27/files#diff-ce261e4d4b0185c8defbfcd46ebe8311a3ecb7ab81d653a2c6664c840340ab2cR250-R251 where it was used as a flag to leak tasks - however we now don't leak tasks but instead cancel them and wait for them
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.
which is this: https://trio.readthedocs.io/en/stable/reference-io.html#trio.aclose_forcefully
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.
@hendrikmakait thanks for the review, it helped clarify my thinking on this!
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.
nit: Would it make sense to rename
fast
toforce
?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.
Yeah I think "forcefully=True" is probably the best here