Skip to content

spawn pool: workers never self-terminate and spin until TTL after drain (cost leak) #1146

Closed

Description

@scttfrdmn

Split from #1134.

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.

  1. 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.
  2. 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

  1. added this to the v0.136.0 milestone on Oct 19, 2026
  2. scttfrdmn commented on Oct 19, 2026

    @scttfrdmn
    ContributorAuthor

    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.

  3. added 5 commits that reference this issue on Oct 19, 2026
    d4e2118
    b793afc
    cfef98d
    679716c
    c1726f2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions