Repository navigation
fix(engine): queue agent stages behind the sandbox's one-at-a-time limit (#13) - #14
Conversation
…dboxd runs one agent stage at a time (#13)
Decision: Tests Run
Raw runtime output was retained in local Gitmoot state and is not posted here. |
Closes #13. Part of epic #2. Found during the #8 deploy.
Problem
On hetzner2, the scheduled
canaryrun's agent stage started while a manualcanary-overcapagent stage was still running. Its run gateway could not bind the instance's single host port, and the run failed:bind: address already in use.Change
stage.Limiter: a new optional interface,MaxConcurrent() int.agentexec.Executorforwards it from its backend, andagentexec.Sandboxdreturns 1 (one host port,max-vms 1).e.mu. The slot is released when the attempt's goroutine ends, or at once ifstartfails before launching.pending.Verification
go vetpasses, andgo test -race ./...passes.TestLimitedExecutorQueuesStagesAcrossRuns: two pipelines with one agent stage each, on an executor that allows 1 at a time and fails any overlap. Both runs succeed, sequentially, with no overlap.test-check prove: proven. The test fails onmainand passes here.Deployment
hetzner2
stagehand.service: replace the binary and restart, as part of #8. Rollback: the previous binarystagehand-dd58c28in/root/fleet-tools/state/gitmoot-pipe/bin/.