gh-113538: Don't crash in stream reader protocol callback when task is cancelled#113690
Merged
Conversation
gvanrossum
requested review from
1st1,
asvetlov,
kumaraditya303 and
willingc
as code owners
January 3, 2024 22:15
Contributor
|
is there a test case we can add that would cover the issue and fix? |
jsundahl
approved these changes
Jan 4, 2024
jsundahl
left a comment
There was a problem hiding this comment.
looks good, I do think closing the transport if the task is cancelled is the correct thing to do.
itamaro
approved these changes
Jan 4, 2024
itamaro
left a comment
Contributor
There was a problem hiding this comment.
thanks for adding a test case! LG!
kumaraditya303
approved these changes
Jan 4, 2024
|
Thanks @gvanrossum for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Jan 4, 2024
…task is cancelled (pythonGH-113690) (cherry picked from commit 4681a52) Co-authored-by: Guido van Rossum <guido@python.org>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Jan 4, 2024
…task is cancelled (pythonGH-113690) (cherry picked from commit 4681a52) Co-authored-by: Guido van Rossum <guido@python.org>
|
GH-113713 is a backport of this pull request to the 3.12 branch. |
|
GH-113714 is a backport of this pull request to the 3.11 branch. |
gvanrossum
added a commit
that referenced
this pull request
Jan 4, 2024
gvanrossum
added a commit
that referenced
this pull request
Jan 4, 2024
kulikjak
pushed a commit
to kulikjak/cpython
that referenced
this pull request
Jan 22, 2024
…task is cancelled (python#113690)
aisk
pushed a commit
to aisk/cpython
that referenced
this pull request
Feb 11, 2024
…task is cancelled (python#113690)
Glyphack
pushed a commit
to Glyphack/cpython
that referenced
this pull request
Sep 2, 2024
…task is cancelled (python#113690)
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.
That callback exists purely to log an error when the coroutine running in the task raises an exception. But if the task was cancelled instead, the callback itself crashes, which just logs noise. In that case we should just close the transport without logging anything.
CC @jsundahl