Skip to content

🍒 Backports #686 to v0.5: 🧵 Fix deadlock in #disconnect#697

Merged
nevans merged 1 commit into
v0.5-stablefrom
backport/v0.5/686/fix-disconnect-deadlock
Jun 9, 2026
Merged

🍒 Backports #686 to v0.5: 🧵 Fix deadlock in #disconnect#697
nevans merged 1 commit into
v0.5-stablefrom
backport/v0.5/686/fix-disconnect-deadlock

Conversation

@nevans

@nevans nevans commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

#disconnect could deadlock when called inside the mutex, because the receiver thread could be signaling a condition variable and it would thus be unable to resume until the current thread releases its lock.

Also, #disconnect shouldn't raise IO#shutdown exceptions on the receiver thread prior to closing the socket, when it is being called from the receiver thread. The exception is still raised, after the socket is closed.

`#disconnect` could deadlock when called inside the mutex, because the
receiver thread could be signaling a condition variable and it would
thus be unable to resume until the current thread releases its lock.

Also, `#disconnect` shouldn't raise `IO#shutdown` exceptions on the
receiver thread prior to closing the socket, when it is being called
from the receiver thread.  The exception is still raised, _after_ the
socket is closed.
@nevans nevans added the bug Something isn't working label Jun 9, 2026
@nevans nevans merged commit fac1733 into v0.5-stable Jun 9, 2026
59 of 66 checks passed
@nevans nevans deleted the backport/v0.5/686/fix-disconnect-deadlock branch June 9, 2026 13:40
@nevans nevans added the backport This issue or PR is for a stable release branch label Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This issue or PR is for a stable release branch bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant