-
Notifications
You must be signed in to change notification settings - Fork 128
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
Different cancel scope behaviour on asyncio vs Trio #698
Labels
bug
Something isn't working
Comments
As my second comment at the linked post says, Trio changed to the current behaviour in version 0.11.0 (2019-02-09). |
I tried fixing this by raising a new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Things to check first
I have searched the existing issues and didn't find my bug already reported there
I have checked that my bug is still present in the latest release
AnyIO version
4.3.0
Python version
3.10.13; 3.12.1
What happened?
Run a cancel scope within another cancel scope. Cancel the inner one then
await
something so that a cancellation exception is raised, but during handling also cancel the outer one (but do not call any more unshielded async functions before the end of the inner block). With the asyncio backend, the inner block will swallow the cancellation exception, allowing the outer block to continue running (until the next unshieldedawait
in it), while the Trio backend will propagate the exception right out to the end of the outer blockBy the way, the Trio docs give the impression that it is meant to work the same way as the asyncio backend does. (See discussion on Trio Discourse: Do
Cancelled
exceptions “know” which block they belong to?)How can we reproduce the bug?
Output with Trio backend:
Output with asyncio backend:
The text was updated successfully, but these errors were encountered: