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
spawn pool: workers never self-terminate and spin until TTL after drain (cost leak) #1146
Found in code while writing the tasks-and-pools guide for spore-host/spore-host#585 part 3. Not run on AWS. The guide documents the current behaviour and warns: one pool at a time per account, and always pool drain.
Workers don't self-terminate.
On a clean drain the worker loop just breaks (cmd/pool.go:161-164), and nothing writes /tmp/SPAWN_COMPLETE, so on_complete never fires.
spored's idle action is stop, never terminate (pkg/agent/agent.go:765-769).
So "Workers self-terminate on idle-timeout (scale to zero)" (cmd/pool.go:58), the drain message (:458) and pkg/taskpool/pool.go:90 overstate it. A stopped worker still bills EBS until the TTL.
After pool drain deletes the queue, workers spin until TTL.Worker.Run retries every claim error once a second and never checks its idle deadline on that path (pkg/taskpool/worker.go:93-101).
Activity
scttfrdmn commentedon Oct 19, 2026
Decision needed (milestone planning, 2026-10-18): should pool workers (and
spawn service) terminate when idle or drained, instead of stopping?Default if there's no objection: terminate. The help text already promises it, and a stopped worker keeps billing its EBS volume.
fix(pool): workers terminate when drained; drain is idempotent; add -…
fix: app launch default TTL; service and pool workers terminate on id…
fix: app launch default TTL; service and pool workers terminate on id…
fix: app launch default TTL; service and pool workers terminate on id…
fix(pool): workers terminate when drained; drain is idempotent; add -…