Add nowait flag to asyncio.Connection.disconnect()#2356
Merged
Conversation
6ca1c3b to
1cddc0b
Compare
6 tasks
Codecov ReportBase: 92.17% // Head: 92.17% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #2356 +/- ##
=======================================
Coverage 92.17% 92.17%
=======================================
Files 110 110
Lines 28924 28866 -58
=======================================
- Hits 26661 26608 -53
+ Misses 2263 2258 -5
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
kristjanvalur
added a commit
to mainframeindustries/redis-py
that referenced
this pull request
Aug 25, 2022
This can result in other errors such as timeouts.
kristjanvalur
added a commit
to mainframeindustries/redis-py
that referenced
this pull request
Aug 25, 2022
This can result in other errors such as timeouts.
kristjanvalur
added a commit
to mainframeindustries/redis-py
that referenced
this pull request
Aug 25, 2022
This can result in other errors such as timeouts.
kristjanvalur
added a commit
to mainframeindustries/redis-py
that referenced
this pull request
Aug 25, 2022
This can result in other errors such as timeouts.
8b403ef to
987bb8e
Compare
dvora-h
approved these changes
Aug 29, 2022
987bb8e to
b4fec8b
Compare
akx
reviewed
Sep 19, 2022
kristjanvalur
added a commit
to mainframeindustries/redis-py
that referenced
this pull request
Sep 19, 2022
This can result in other errors such as timeouts.
kristjanvalur
added a commit
to mainframeindustries/redis-py
that referenced
this pull request
Sep 26, 2022
This can result in other errors such as timeouts.
d681abf to
ae80bf2
Compare
kristjanvalur
added a commit
to mainframeindustries/redis-py
that referenced
this pull request
Sep 28, 2022
This can result in other errors such as timeouts.
Collaborator
|
@kristjanvalur Can you resolve the conflicts with master? |
This can result in other errors such as timeouts.
Co-authored-by: Aarni Koskela <[email protected]>
ae80bf2 to
6208b66
Compare
nowait flag to asyncio.Connection.disconnect()
kristjanvalur
added a commit
to mainframeindustries/redis-py
that referenced
this pull request
Sep 29, 2022
This can result in other errors such as timeouts.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull Request check-list
Please make sure to review and check all of these items:
$ toxpass with this change (including linting)?NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.
Description of change
When the
asyncio.Connectionobject encounters an exception, it often performs aself.disconnect(). This changeadds a
nowaitflag to this method, so that in the error case,disconnect()does not attempt to await await_closed()on the output stream. Awaiting a buffer method at this point can cause other errors to occur.Notably an
asyncio.CancelledErrorcould happen, in case the entire operation is enclosed in aasync_timeout.timeout()context manager.At any rate, if the connection is in an error state, there is no need to wait for the write buffer flush.
This PR is separate from a related pr, #2104, both about making exception handling and cancelling (via Timeout) possible.