Problem
In the concurrent dispatch finally path added by #167, cleanupDispatch(...) runs before workspaceSlots.release(...) when no assignment was stored. If cancellation or lock cleanup throws, control exits the finally block before the slot release. The reservation and workspace root then remain busy until TTL expiry instead of being released immediately.
Location
service/src/bridge/store.ts, the uncommitted dispatch cleanup and unassigned slot release around lines 1061–1074.
Expected behavior
Attempt slot release even when dispatch cleanup fails, while preserving the correct primary cleanup error. Add a regression test where cleanup throws after a concurrent reservation succeeds but before assignment storage.
Reported while syncing #167 into ClickHouse/ai; Bugbot discussion: https://github.com/ClickHouse/ai/pull/3674#discussion_r3964747711
Problem
In the concurrent dispatch
finallypath added by #167,cleanupDispatch(...)runs beforeworkspaceSlots.release(...)when no assignment was stored. If cancellation or lock cleanup throws, control exits thefinallyblock before the slot release. The reservation and workspace root then remain busy until TTL expiry instead of being released immediately.Location
service/src/bridge/store.ts, the uncommitted dispatch cleanup and unassigned slot release around lines 1061–1074.Expected behavior
Attempt slot release even when dispatch cleanup fails, while preserving the correct primary cleanup error. Add a regression test where cleanup throws after a concurrent reservation succeeds but before assignment storage.
Reported while syncing #167 into ClickHouse/ai; Bugbot discussion: https://github.com/ClickHouse/ai/pull/3674#discussion_r3964747711