You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
runtime: a State panic in the deferred prelude leaks the queue turn record and admission slot #135
runtime: under DispatchDeferred, a panicking State.AcquireLock in the prelude leaks the queue turn record and the admission slot.
What happens
Under DispatchDeferred, the prelude's AcquireLock runs on the net/http handler goroutine.
If that call panics, net/http recovers the panic, but dispatchDeferred (runtime.go#L711-L718) never calls release.
The scope's turn record and the admission slot both stay taken. Shutdown then waits for the slot and returns context deadline exceeded.
The independent verifier of #134 reproduced this with a real httptest.Server. It got the same result on e93bdb8, before #134, so #134 did not cause it. There is no committed test for it yet.
Scope
#129 and #134 cover the DispatchSync path: a State panic while a queue waiter polls. This issue is the deferred-dispatch path, which #129 did not list.
Possible fix
Release the admission and leave the queue scope on every exit from the deferred prelude, a panic included (for example a defer that runs the idempotent release when the tail never started). First commit: a failing test that panics AcquireLock once under DispatchDeferred, then asserts Shutdown returns promptly and QueueTurnCount is 0.
Owner and trigger
The coder/chat maintainer triages this. Fix it with the next change to deferred dispatch, or before the queue strategy is called production-grade, whichever comes first.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: xhigh
Triage: confirmed bug, ready-for-agent. The possible fix in the issue is the plan. The first commit must be the failing test it describes: a State whose AcquireLock panics once under DispatchDeferred, behind a real httptest.Server, then an assertion that Shutdown returns promptly and QueueTurnCount is 0. The fix must reuse the idempotent release from #134, so a panic and a normal exit cannot release twice.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: medium
Activity
ThomasK33 commentedon Oct 29, 2026
Triage: confirmed bug,
ready-for-agent. The possible fix in the issue is the plan. The first commit must be the failing test it describes: aStatewhoseAcquireLockpanics once underDispatchDeferred, behind a realhttptest.Server, then an assertion thatShutdownreturns promptly andQueueTurnCountis 0. The fix must reuse the idempotent release from #134, so a panic and a normal exit cannot release twice.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:mediumfix(runtime): free the admission slot when the deferred prelude panics (