Skip to content

fix(sync): survive an exception raised by a signal handler during a sync call - #3230

Merged
Pavel Feldman (pavelfeldman) merged 1 commit into
microsoft:mainfrom
pavelfeldman:fix-3222
Oct 8, 2026
Merged

Pavel Feldman (pavelfeldman) merged 1 commit into
microsoft:mainfrom
pavelfeldman:fix-3222

Conversation

@pavelfeldman

Copy link
Copy Markdown
Member

Summary

  • An exception raised by a signal handler (e.g. pytest-timeout's signal method) while a sync call waits lands inside the dispatcher greenlet and ends it. The dispatcher now hands the exception to the waiting user greenlet, stays alive and runs the loop again on the next call.
  • wait_for_future owns the resume callback and removes it when a wait is abandoned, so the cancelled call cannot resume the user greenlet later.

Fixes #3222

@pavelfeldman
Pavel Feldman (pavelfeldman) merged commit f5ac944 into microsoft:main Oct 8, 2026
29 checks passed
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.

[Bug]: Exception raised by a signal handler kills the sync dispatcher fiber, every later sync call spins at 100% CPU

2 participants