-
-
Notifications
You must be signed in to change notification settings - Fork 953
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
avoid collapsing exception groups from user code #2830
base: master
Are you sure you want to change the base?
Conversation
@@ -258,7 +259,7 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: | |||
except OSError: | |||
raise ClientDisconnect() | |||
else: | |||
async with anyio.create_task_group() as task_group: | |||
async with create_collapsing_task_group() as task_group: |
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.
Do we also have an issue with StreamingResponse
standalone?
With my comment on the other PR I was trying to avoid the changes 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.
Yeah it's the same sort of issue, but it's wrapped in two TaskGroups before the user gets the exception. Collapsing is ok here because if wait_for_disconnect raises an exception it is always 'catastrophic' eg won't be caught
Summary
If user code is raising ExceptionGroups eg from TaskGroups or otherwise, they should get ExceptionGroups raised. There could also be important notes attached.
Checklist
No docs changes needed, probably should have made an issue for this.