Skip to content

Fix connection deadlock - #100

Open
rschlaikjer wants to merge 3 commits into
masterfrom
rs-fix-connection-deadlock
Open

Fix connection deadlock#100
rschlaikjer wants to merge 3 commits into
masterfrom
rs-fix-connection-deadlock

Conversation

@rschlaikjer

Copy link
Copy Markdown
Contributor

Removed a deadlock that occurred when re-subscribing after a subscription dropped. _EnsureWebSocketConnection waited for the WebSocket to open while holding the subscription lock, which the background thread needs in order to report the dropped subscription, so neither thread could make progress. Connection setup now happens outside the subscription lock and is bounded by the subscribe timeout.

Same pattern that was previously fixed for _Subscribe/_Unsubscribe with
a timeout. The caller thread can hold _subscriptionLock and wait for a
coroutine that runs on the event loop. However, the event loop is
blocked acquiring _subscriptionLock inside the dropped-subscription handler.
@rschlaikjer
rschlaikjer requested a review from woswos August 13, 2026 08:55
@rschlaikjer rschlaikjer self-assigned this Aug 13, 2026
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.

1 participant