Skip to content

Detached spawn resume re-invokes the sweep orchestrator without marking the sweep regions in the lifecycle lease #1675

Backlog

Description

@scttfrdmn

Found while working on #1672. Part of the leave-no-trace epic, spore-host/spore-host#752.

The gap

A detached sweep's members are launched by the sweep-orchestrator Lambda, through SpawnSweepCrossAccountRole. The orchestrator never marks the lifecycle lease, by design: the CLI marks for it. launchSweepDetached marks every sweep region and global with the compute credentials before it invokes the orchestrator (cmd/launch_sweep.go:1407). While the sweep runs, the reaper counts its unfinished record as activity (lambda/ttl-reaper/accountidle.go, the header's "These are what the orchestrator Lambdas launch from, so they cover the launches no CLI marks").

spawn resume of a detached sweep skips the regional mark:

  • resumeSweepDetached (cmd/resume.go:535) refuses only COMPLETED (:560). So it resumes a FAILED or CANCELLED sweep, which the reaper's verdict counts as finished (sweepFinished, lambda/ttl-reaper/accountidle.go:275).
  • It then calls sweep.InvokeSweepOrchestrator (:605) without marking the sweep's regions.
  • It marks only global, and only through requireDetachedSweepRole (cmd/sweep_role.go:147, before it ensures the role). It never marks a region.

The race this leaves:

  1. A region's scope has been idle for the grace.
  2. The teardown takes the lease and re-checks. The sweep's record says finished.
  3. spawn resume invokes the orchestrator. Nothing waits on the lease, because nothing marked.
  4. The orchestrator launches members, and possibly egress-proxy groups, into a region whose teardown holds the lease and is deleting spawn's security groups and key pairs there.

Today this is report mode only. Nothing is deleted until spawn#1657 arms reap, so this needs fixing before then.

TestEveryCreatorMarksTheLease doesn't see this gap. The creates are the Lambda's, and the gate walks only from CLI commands to creating actions.

Fix

  • Before InvokeSweepOrchestrator, mark the regions the resume launches into and global, with the compute config, as launchSweepDetached does. The regions are resolveResumeRegions plus the parameter file's regions.
  • Add a gate: every CLI path that invokes the sweep orchestrator (sweep.InvokeSweepOrchestrator), or writes a schedule it fires, calls lifecyclemark.Mark first.

Activity

  1. added this to the Leave no trace milestone on Nov 25, 2026
  2. added
    area:lifecycle
    on Nov 25, 2026
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

    area:lifecyclecomponent:spawntype:bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions