Skip to content

spawn pool: workers never terminate, concurrent pools clobber each other's role, pooled outputs likely untagged #1134

Closed

Description

@scttfrdmn

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).
  3. Every pool shares the role spawn-pool-worker (cmd/pool.go:288). CreateOrGetInstanceProfile overwrites its single inline policy (pkg/aws/iam.go:499-503), which is scoped to one run's queue. A second pool create therefore cuts the first pool's workers off from their queue.
  4. Pooled outputs are probably untagged. The worker policy grants s3:PutObject but not the tagging/annotation actions that task run grants for provenance (cmd/pool.go:93-104 vs cmd/task.go:1165-1170). This contradicts the results-retention guide (Write-time recompute tag: record compute used + output size on result objects, so retention can be decided by rule #1076).
  5. No ECR pull grant, so a private-ECR image can't run in a pool.

Minor:

  • The visibility timeout comment says "sized from the TTL"; it's a fixed 900 (cmd/pool.go:208).
  • docs/pooled-task-execution-design.md §4 describes a reconcile loop that tops up and replaces reaped Spot workers, but pool create reconciles once and returns (:347).
  • pkg/taskpool/worker.go:185 assumes a failed completion record exists, but a spec that fails to parse writes none and is still acked.

Activity

  1. scttfrdmn commented on Oct 19, 2026

    @scttfrdmn
    ContributorAuthor

    Split into: #1146 (workers never terminate and spin after drain, items 1+2), #1147 (shared spawn-pool-worker role clobbered by concurrent pools, item 3), #1148 (pooled outputs untagged and no ECR grant, items 4+5), #1149 (minor items). Closing as split.

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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions