Skip to content

Fix potential deadlock if open_loop() is cancelled#128

Merged
tjstum merged 2 commits intopython-trio:masterfrom
oremanj:fix-startup-deadlock
Dec 1, 2023
Merged

Fix potential deadlock if open_loop() is cancelled#128
tjstum merged 2 commits intopython-trio:masterfrom
oremanj:fix-startup-deadlock

Conversation

@oremanj
Copy link
Member

@oremanj oremanj commented Dec 1, 2023

Resolves #115. This also modifies the "cancel and await all asyncio tasks" logic to run even if open_loop() is cancelled or sees an exception, because that's another potential source of deadlocks -- the Trio tasks in the tasks_nursery might need to block on asyncio work as they unwind.

@tjstum
Copy link
Member

tjstum commented Dec 1, 2023

Nice fix.

LGTM

@tjstum tjstum merged commit 7712c98 into python-trio:master Dec 1, 2023
@oremanj oremanj deleted the fix-startup-deadlock branch February 1, 2024 19:38
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.

trio_asyncio shielding cancellation causes errors to be silenced.

2 participants