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

[3.11] GH-95704: Don't suppress errors from tasks when TG is cancelled (GH-95761) #96048

Merged
merged 1 commit into from Aug 17, 2022

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Aug 17, 2022

When a task catches CancelledError and raises some other error,
the other error should not silently be suppressed.

Any scenario where a task crashes in cleanup upon cancellation
will now result in an ExceptionGroup wrapping the crash(es)
instead of propagating CancelledError and ignoring the side errors.

NOTE: This represents a change in behavior (hence the need to
change several tests). But it is only an edge case.

Co-authored-by: Thomas Grainger tagrain@gmail.com
(cherry picked from commit f51f54f)

Co-authored-by: Guido van Rossum guido@python.org

…pythonGH-95761)

When a task catches CancelledError and raises some other error,
the other error should not silently be suppressed.

Any scenario where a task crashes in cleanup upon cancellation
will now result in an ExceptionGroup wrapping the crash(es)
instead of propagating CancelledError and ignoring the side errors.

NOTE: This represents a change in behavior (hence the need to
change several tests).  But it is only an edge case.

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
(cherry picked from commit f51f54f)

Co-authored-by: Guido van Rossum <guido@python.org>
@gvanrossum
Copy link
Member

gvanrossum commented Aug 17, 2022

@pablogsal -- this is a small change to TaskGroup itself, but it does change a bunch of TaskGroup tests that were previously expecting side errors to be ignored.

@gvanrossum gvanrossum removed request for 1st1 and asvetlov Aug 17, 2022
@miss-islington
Copy link
Contributor Author

miss-islington commented Aug 17, 2022

Status check is done, and it's a success .

@miss-islington miss-islington merged commit 36c114a into python:3.11 Aug 17, 2022
15 checks passed
@miss-islington miss-islington deleted the backport-f51f54f-3.11 branch Aug 17, 2022
@gvanrossum
Copy link
Member

gvanrossum commented Aug 17, 2022

Whoa, Miss-Islington auto-merged it. I did not expect that. Sorry.

@pablogsal
Copy link
Member

pablogsal commented Aug 17, 2022

Whoa, Miss-Islington auto-merged it. I did not expect that. Sorry.

Don't worry about it. I reviewed it and looks good 👍

@pablogsal
Copy link
Member

pablogsal commented Aug 17, 2022

Thanks for the explanation in the meeting!

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.

None yet

4 participants