Skip to content

fix(sync): raise instead of spinning after the driver exits - #3224

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

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

Conversation

@pavelfeldman

Copy link
Copy Markdown
Member

Summary

  • Once the connection to the driver ends, the dispatcher fiber is dead and switching to it returns immediately, so pending and later sync calls spun at 100% CPU forever instead of raising.
  • SyncBase._sync, EventInfo.value and DisposableStub._sync now share one wait helper that raises TargetClosedError("Playwright connection closed") when the dispatcher is gone; the loop is only marked as running while the dispatcher is alive, so stop() and restarting keep working.

Reported in #3187.

The dispatcher fiber finishes once the connection to the driver ends.
Switching to a dead greenlet returns immediately, so every sync wait
loop degenerated into a 100% CPU busy loop that never raised.
SyncBase._sync, EventInfo.value and DisposableStub._sync now share one
wait helper that raises TargetClosedError when the dispatcher is gone.

Reported in microsoft#3187
@pavelfeldman
Pavel Feldman (pavelfeldman) merged commit 47072d5 into microsoft:main Oct 6, 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.

2 participants