Skip to content

common/interrupt: close connections outside group lock - #4329

Open
embogomolov wants to merge 232 commits into
SagerNet:testingfrom
embogomolov:fix/interrupt-group-deadlock
Open

common/interrupt: close connections outside group lock#4329
embogomolov wants to merge 232 commits into
SagerNet:testingfrom
embogomolov:fix/interrupt-group-deadlock

Conversation

@embogomolov

Copy link
Copy Markdown

Remove matching connections from the group while holding the mutex, then close them after releasing it. This prevents lock inversion between nested interrupt groups.

Added a regression test that deadlocks on the current code and passes with this change. go test ./common/interrupt passes across 100 repeated runs.

Fixes #4328

@nekohasekai
nekohasekai force-pushed the testing branch 24 times, most recently from 067b00f to 4f7f894 Compare July 29, 2026 13:44
@nekohasekai
nekohasekai force-pushed the testing branch 2 times, most recently from 2557cf6 to f141553 Compare July 31, 2026 08:16
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.

Nested interrupt groups can deadlock during connection interruption

6 participants