Keep long tool calls from starving the worker pool #24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/long-call-slots"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
The shared hub hung twice on 2026-09-19. Every forgejo call timed out, including
get_forgejo_mcp_server_version. Root cause (evidence in #23): mcp-go's stdio server has 5 tool workers,wait_for_runholds one for up to 30 min, and abandoned calls are never cancelled. At both restarts, 6 or 7wait_for_runcalls were in flight (wait cancelled by caller (context done)× 7 at 15:22:33 and × 6 at 15:53:27 CEST).What
pkg/admission: long-running tools (wait_for_run,list_workflow_runs,list_run_jobs) share 16 slots. When all are taken, the next long call is rejected immediately with a clear message instead of occupying a worker.ServeStdionow runs 64 workers (default was 5), so at least 48 are always free for short calls.Proof
TestShortCallAnswersWhileLongSlotsAreFull: it holds 16 long calls, sends 8 surplus calls (all rejected), then checks thatget_forgejo_mcp_server_versionanswers in under 2 s. It fails against the old setup (5 workers, no limit:no response to request 2 within 2s) and passes with the fix.go test ./...passes.Closes #23
Refs Philflow/auto-issue-orchestrator#215
🤖 Generated with Claude Code