Skip to content

Fix SSE fan-out fallback disconnect deadlock (#268) - #270

Merged
shoedog merged 1 commit into
mainfrom
fix/sse-disconnect-deadlock-268
Nov 2, 2026
Merged

shoedog merged 1 commit into
mainfrom
fix/sse-disconnect-deadlock-268

Conversation

@shoedog

@shoedog shoedog commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #268. In served SSE fan-out fallback, a client disconnect awaited cancellation without polling the retained fan-out work. Both paths acquire the coordinator-wide bindings mutex, which is FIFO, so a local driver queued for it kept the released permit reserved while unpolled: the producer hung forever and every later bindings acquisition blocked.

  • The disconnect arm now polls cancellation and the retained work concurrently, so the queued driver can take and release its reservation.
  • Cancellation precedence is preserved ahead of aggregate finalization (review round 1 found a concurrent-completion race that could defeat it; fixed in round 2).
  • Tests: queued-driver disconnect (RED on base: hang), completed and idle peers, cancellation after SSE exposure; the reviewed-version completion race is RED before the round-2 fix.

The deployed serve release predates the affected code; the next serve swap would have shipped it.

Verification

  • Container (Sol): workspace 6,370 passed / 0 failed / 13 ignored (CARGO_INCREMENTAL=0); fmt, clippy -D warnings, hygiene; goldens unchanged; wire SHA equals base.
  • Host: fmt, clippy (bridge-a2a-inbound, -D warnings) clean; bridge-a2a-inbound 321/321; uncapped_order_and_wire_control byte-identical to base.
  • Review: gpt-6-astra, 2 rounds, APPROVE. Deferred SMELL: the completed-peer cancellation assertion observes an unused fake.

🤖 Generated with Claude Code

https://claude.ai/code/session_017izEynabPeSUBT573AtvaZ

Poll cancellation alongside retained fan-out work so a queued local driver
can release its FIFO bindings-mutex reservation. Cover queued-driver
disconnect, completed and idle peers, and cancellation after SSE exposure.


Fixes #268.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017izEynabPeSUBT573AtvaZ
@shoedog
shoedog merged commit 39f29c9 into main Nov 2, 2026
6 checks passed
@shoedog
shoedog deleted the fix/sse-disconnect-deadlock-268 branch November 2, 2026 02:09
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSE fan-out fallback: client disconnect can deadlock the bindings mutex

1 participant