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
Detached spawn resume re-invokes the sweep orchestrator without marking the sweep regions in the lifecycle lease #1675
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:
A region's scope has been idle for the grace.
The teardown takes the lease and re-checks. The sweep's record says finished.
spawn resume invokes the orchestrator. Nothing waits on the lease, because nothing marked.
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