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#210 partial regression on v0.62.0: capacity-failed polls still orphan FSx on launcher.Provision (likely 1 per AZ attempt) — 3 live orphans preserved as evidence #220
Partial regression of #210 on spawn v0.62.0 — capacity-failed polls STILL create orphan FSx on the launcher.Provision path
#210 was closed as fixed in v0.61.0 (#213) with the structural guarantee: create FSx only AFTER a
successful RunInstances, so a capacity-failed launch issues zero CreateFileSystem calls. Verified
live on spawn v0.62.0 + lagotto v0.47.0: that guarantee is not fully holding under the
lagotto retry loop. The autonomous run that eventually succeeded ALSO left 3 orphans from the
capacity-failed polls that preceded it.
Live evidence (left IN PLACE for you to investigate — not deleted)
us-west-2, account 942542972736:
FSx ID
Lifecycle
Created (PDT)
Status
fs-02a0009ba1c09080a
AVAILABLE
2026-06-17 17:41:34
ORPHAN — no instance, no spawn:fsx-id/-pending
fs-04c458d4b059922f2
AVAILABLE
2026-06-17 17:41:43
ORPHAN
fs-0508902e2e10de14e
AVAILABLE
2026-06-17 17:41:50
ORPHAN
fs-061e0669c2bfffd43
CREATING
2026-06-17 17:47:24
legit — referenced by the launched instance
Launched instance i-0a26ce433fc3cd8e4 (us-west-2a, LaunchTime 2026-06-18T00:47:26Z = 17:47 PDT)
carries tag spawn:fsx-pending = fs-061e0669c2bfffd43 — that's the good one, created at the
17:47 successful launch.
I have left all three in place so you can inspect creation context / logs and exercise the
reaper or whatever cleanup path should have caught them. Please confirm before I delete them.
What this means
The #213 "create-only-after-launch" ordering is being violated on the headless launcher.Provision path when polls interleave rapidly — three CreateFileSystem calls fired for
capacity-failed launches at 17:41. Hypotheses:
The AZ-retry loop inside Provision may create FSx per-AZ-attempt (3 orphans ≈ 3 AZ tries in one
poll) rather than once-after-success — i.e. the create moved before the launch per AZ even if
it's after-launch in the single-AZ happy path.
Or a poll that did get a transient launch acceptance then failed downstream created+leaked.
The 3-orphans-per-incident count strongly suggests one FSx per AZ attempt (us-west-2a/b/c),
which points at the AZ loop (lagotto#34 exhaust-all-AZs) interacting badly with FSx-create
placement in Provision.
Severity
Much slower than the original (3 per capacity-blocked poll-burst vs 84), but same class and same
cost model — orphaned 1.2 TiB PERSISTENT_2 filesystems billing ~$0.145/GiB-mo, no owner, only
reclaimed if a reaper runs (absent in end-user accounts — see #210 point 3 / lagotto#29). Under a
long capacity drought (we've seen 12.5h) this still accumulates.
Heads-up: the 3 evidence orphans (fs-02a0009ba1c09080a, fs-04c458d4b059922f2, fs-0508902e2e10de14e) are now gone (FileSystemNotFound) — reclaimed by something on your side (reaper or manual cleanup) since I filed this. I did NOT delete them. So the live evidence is no longer inspectable, but the timestamps/IDs + the per-AZ hypothesis in the original report stand: 3 orphans created 17:41 PDT during capacity-failed polls, ≈ one per AZ attempt, minutes before the 17:47 successful launch. If you need a fresh repro I can reproduce by running a scoped lagotto daemon against g5.12xlarge during a capacity drought.
Reproduced again on a second autonomous run — same per-AZ pattern, fresh evidence available NOW
Second run (instance i-0bd872b7415c39ef9, launched 2026-06-18T03:36:16Z = 20:36 PDT, us-west-2c):
FSx ID
Created (PDT)
Status
fs-084c345546856d1c0
20:30:23
ORPHAN (capacity-failed poll)
fs-04c261d836f2efb45
20:30:29
ORPHAN
fs-0a8b82015b03f7f08
20:30:36
ORPHAN
fs-0a4eef54cb66516bb
20:36:07
CREATING (~7s before the attached one — possibly also orphaned; watching)
fs-04cbb94a673c9274b
20:36:14
LEGIT — instance's spawn:fsx-pending
The 3 at 20:30 are from a capacity-failed poll ~6 min before the 20:36 successful launch — exactly one per AZ (the daemon tried all 3 us-west-2 AZs that cycle, each created an FSx, all failed RunInstances, none torn down). This nails the hypothesis: FSx CreateFileSystem is happening per-AZ-attempt inside the launch loop, BEFORE RunInstances succeeds — so #213's 'create only after successful launch' isn't holding on the multi-AZ retry path.
These orphans (fs-084c34..., fs-04c261..., fs-0a8b82...) are live right now if you want to inspect them before I clean up — I'll leave them ~30 min. The fix likely needs to move the CreateFileSystem call to after a RunInstances success within the per-AZ loop, not once per Provision call.
Cleaning up the 3 evidence orphans now — they've been AVAILABLE 7 days ($120 of FSx billed) and the issue already has the IDs, timestamps, and the per-AZ root-cause diagnosis, so the live filesystems add nothing further. Deleting fs-084c345546856d1c0, fs-04c261d836f2efb45, fs-0a8b82015b03f7f08. The repro is deterministic (every capacity-failed multi-AZ poll burst orphans one FSx per AZ) if a fresh repro is needed.
So on the path whose log line is provision: launch: ... InsufficientInstanceCapacity — that's client.Launcherroring, which happens strictly before the FSx-create step. This code cannot create an FSx on that error path, on any AZ. The issue's hypothesis ("CreateFileSystem per-AZ-attempt before RunInstances") precisely describes the pre-#213 (≤ v0.57.0) ordering, which was reordered away in v0.61.0.
The mystery I can't resolve statically: the reporting binary was the released lagotto v0.47.0 → spawn v0.62.0 (confirmed: lagotto v0.42.0→spawn v0.57.0, v0.43.0→v0.61.0, v0.46.0/v0.47.x→v0.62.0), so "stale pre-#213 binary" doesn't obviously explain it. Yet the orphans are deterministic and real (and I don't doubt them).
Two candidate explanations I can't distinguish without more data:
A different create site. Something other than the client.Launch-errors path is creating FSx — e.g. RunInstances returns 200 (so Provision legitimately creates FSx + tags the instance) but the instance is then terminated by AWS with a capacity state-reason (a 200-then-die, distinct from an API error). spawn's Launch trusts the RunInstances 200 and doesn't verify post-launch state, so the FSx would be created and then orphaned when the instance dies — a real but different bug than "CRITICAL: --fsx-create creates FSx BEFORE launch succeeds; capacity-failed launches orphan 1.2TiB filesystems → quota exhaustion + ~$14.6k/mo cost (compounds under lagotto retry) #210 regression", and one the daemon log would show as a success not provision: launch: ....
What would settle it (could you grab any of these from the repro?):
The daemon log lines for the orphaning cycle(s) — specifically whether they read provision: launch: ...InsufficientInstanceCapacity (→ pre-FSx error, code can't orphan) or a success line / a different error (→ points at the 200-then-terminate path).
lagotto version from the host that produced them (to nail spawn provenance).
If easy: the orphaned FSx's spawn:fsx-created tag timestamp vs the matching daemon poll-cycle timestamp.
I have a controlled repro planned (drive Provision with a capacity-failing launch + --fsx-create, instrument the exact CreateFileSystem call site). I'll run that next; the log from your repro would let me confirm I'm reproducing the same mechanism rather than a different one. Not closing or "fixing" anything until the create site is pinned down — I'd rather not patch already-correct code.
Resolved — shipped in spawn v0.63.1 + lagotto v0.47.2
The root cause was not the reported pre-launch FSx-ordering regression. I disproved that both statically (the create-after-launch ordering from #213 is intact in the v0.62.0/v0.63.0 tags) and with a live repro (a RunInstancesfailure creates zero FSx — confirmed in 942542972736/us-west-2).
Actual root cause (proven live): a post-launch failure. When RunInstancessucceeded but a downstream step (ephemeral FSx setup) failed, launcher.Provision returned (nil, err)without terminating the now-running instance — orphaning it. Under lagotto's per-AZ retry loop, that error was treated as a failed attempt, so it launched another instance in the next AZ, orphaning one instance (+ any FSx created before the sub-failure) per AZ. That's the observed "3 orphans per capacity burst, ~1 per AZ" — better explained by per-AZ relaunch than by pre-launch creates.
Live before/after proof (cheap t3.micro, leak-checked):
lagotto v0.47.2 (--pre-stop runs as root, should run as the instance user #63): ClassifyFailure treats ErrPostLaunch as terminal, so the AZ sweep stops instead of relaunching per AZ. Bumped to spawn v0.63.1 in both the root and the lambda/capacity-poller submodule.
Note on backstop: the ttl-reaper would eventually reclaim these, but it doesn't run in end-user accounts (lagotto#29), so Provision's own cleanup is the only protection there — which is why the fix belongs in the launch path, not just the reaper.
Thanks for preserving the evidence and reproducing it twice — the per-AZ timing was the key that pointed away from the original hypothesis.
Activity
scttfrdmn commentedon Jun 18, 2026
Heads-up: the 3 evidence orphans (
fs-02a0009ba1c09080a,fs-04c458d4b059922f2,fs-0508902e2e10de14e) are now gone (FileSystemNotFound) — reclaimed by something on your side (reaper or manual cleanup) since I filed this. I did NOT delete them. So the live evidence is no longer inspectable, but the timestamps/IDs + the per-AZ hypothesis in the original report stand: 3 orphans created 17:41 PDT during capacity-failed polls, ≈ one per AZ attempt, minutes before the 17:47 successful launch. If you need a fresh repro I can reproduce by running a scoped lagotto daemon against g5.12xlarge during a capacity drought.scttfrdmn commentedon Jun 18, 2026
Reproduced again on a second autonomous run — same per-AZ pattern, fresh evidence available NOW
Second run (instance
i-0bd872b7415c39ef9, launched 2026-06-18T03:36:16Z = 20:36 PDT, us-west-2c):fs-084c345546856d1c0fs-04c261d836f2efb45fs-0a8b82015b03f7f08fs-0a4eef54cb66516bbfs-04cbb94a673c9274bspawn:fsx-pendingThe 3 at 20:30 are from a capacity-failed poll ~6 min before the 20:36 successful launch — exactly one per AZ (the daemon tried all 3 us-west-2 AZs that cycle, each created an FSx, all failed RunInstances, none torn down). This nails the hypothesis: FSx CreateFileSystem is happening per-AZ-attempt inside the launch loop, BEFORE RunInstances succeeds — so #213's 'create only after successful launch' isn't holding on the multi-AZ retry path.
These orphans (
fs-084c34...,fs-04c261...,fs-0a8b82...) are live right now if you want to inspect them before I clean up — I'll leave them ~30 min. The fix likely needs to move the CreateFileSystem call to after a RunInstances success within the per-AZ loop, not once per Provision call.spawn v0.62.0, lagotto v0.47.0.
scttfrdmn commentedon Jun 24, 2026
Cleaning up the 3 evidence orphans now — they've been AVAILABLE
7 days ($120 of FSx billed) and the issue already has the IDs, timestamps, and the per-AZ root-cause diagnosis, so the live filesystems add nothing further. Deletingfs-084c345546856d1c0,fs-04c261d836f2efb45,fs-0a8b82015b03f7f08. The repro is deterministic (every capacity-failed multi-AZ poll burst orphans one FSx per AZ) if a fresh repro is needed.scttfrdmn commentedon Jun 24, 2026
Investigation: the v0.62.0 code path doesn't match the proposed root cause — need the daemon log to close the gap
Traced this exhaustively against the v0.61.0 and v0.62.0 git tags (not just working trees), because I want to fix the real thing, not guess.
What the shipped v0.62.0 code actually does on the headless/lagotto path:
launcher.Provision, once per AZ inlaunchAcrossAZs(each AZ attempt = a fullProvisioncall).Provision(provision.go, v0.62.0 tag): callsclient.Launchat line 124; ephemeral FSx is created at line 132–133, only afterLaunchreturns success.client.Launchcreates zero FSx — on a capacity failure it returns at theRunInstanceserror (newLaunchError) before any FSx work.v0.61.0(launcher.Provision: create ephemeral FSx AFTER a successful RunInstances (eliminate create/teardown churn on capacity-failed launches) #213, commit 48f6517) andv0.62.0tags.So on the path whose log line is
provision: launch: ... InsufficientInstanceCapacity— that'sclient.Launcherroring, which happens strictly before the FSx-create step. This code cannot create an FSx on that error path, on any AZ. The issue's hypothesis ("CreateFileSystem per-AZ-attempt before RunInstances") precisely describes the pre-#213 (≤ v0.57.0) ordering, which was reordered away in v0.61.0.The mystery I can't resolve statically: the reporting binary was the released lagotto v0.47.0 → spawn v0.62.0 (confirmed:
lagotto v0.42.0→spawn v0.57.0,v0.43.0→v0.61.0,v0.46.0/v0.47.x→v0.62.0), so "stale pre-#213 binary" doesn't obviously explain it. Yet the orphans are deterministic and real (and I don't doubt them).Two candidate explanations I can't distinguish without more data:
client.Launch-errors path is creating FSx — e.g.RunInstancesreturns 200 (soProvisionlegitimately creates FSx + tags the instance) but the instance is then terminated by AWS with a capacity state-reason (a 200-then-die, distinct from an API error). spawn'sLaunchtrusts the RunInstances 200 and doesn't verify post-launch state, so the FSx would be created and then orphaned when the instance dies — a real but different bug than "CRITICAL: --fsx-create creates FSx BEFORE launch succeeds; capacity-failed launches orphan 1.2TiB filesystems → quota exhaustion + ~$14.6k/mo cost (compounds under lagotto retry) #210 regression", and one the daemon log would show as a success notprovision: launch: ....What would settle it (could you grab any of these from the repro?):
provision: launch: ...InsufficientInstanceCapacity(→ pre-FSx error, code can't orphan) or a success line / a different error (→ points at the 200-then-terminate path).lagotto versionfrom the host that produced them (to nail spawn provenance).spawn:fsx-createdtag timestamp vs the matching daemon poll-cycle timestamp.I have a controlled repro planned (drive
Provisionwith a capacity-failing launch +--fsx-create, instrument the exact CreateFileSystem call site). I'll run that next; the log from your repro would let me confirm I'm reproducing the same mechanism rather than a different one. Not closing or "fixing" anything until the create site is pinned down — I'd rather not patch already-correct code.fix: Provision tears down instance on post-launch failure (#220)
chore(security): bump golang.org/x/net to v0.55.0 in dns-updater subm…
fix: Provision tears down instance on post-launch failure (#220) (#230)
scttfrdmn commentedon Jun 24, 2026
Resolved — shipped in spawn v0.63.1 + lagotto v0.47.2
The root cause was not the reported pre-launch FSx-ordering regression. I disproved that both statically (the create-after-launch ordering from #213 is intact in the v0.62.0/v0.63.0 tags) and with a live repro (a
RunInstancesfailure creates zero FSx — confirmed in 942542972736/us-west-2).Actual root cause (proven live): a post-launch failure. When
RunInstancessucceeded but a downstream step (ephemeral FSx setup) failed,launcher.Provisionreturned(nil, err)without terminating the now-running instance — orphaning it. Under lagotto's per-AZ retry loop, that error was treated as a failed attempt, so it launched another instance in the next AZ, orphaning one instance (+ any FSx created before the sub-failure) per AZ. That's the observed "3 orphans per capacity burst, ~1 per AZ" — better explained by per-AZ relaunch than by pre-launch creates.Live before/after proof (cheap t3.micro, leak-checked):
i-0f5c…left running (orphaned).Provisionauto-terminatedi-0fe9…; leak-check clean (zero instances, zero FSx).Fix (two parts):
Provisiontears the instance down on any post-launch failure — a partial provision leaves nothing billable (the FSx auto-create: explicit lifecycle contract (ephemeral|durable), fail-closed, + canonical docs #193 fail-closed contract now extends pastRunInstances). Newlauncher.ErrPostLaunchsentinel wraps these so retry-callers can classify them. Plus a regression test (TestProvision_NoFSxOrphanOnLaunchFailure) and an incidentalx/netsecurity bump that the Trivy gate surfaced.ClassifyFailuretreatsErrPostLaunchas terminal, so the AZ sweep stops instead of relaunching per AZ. Bumped to spawn v0.63.1 in both the root and thelambda/capacity-pollersubmodule.Note on backstop: the ttl-reaper would eventually reclaim these, but it doesn't run in end-user accounts (lagotto#29), so
Provision's own cleanup is the only protection there — which is why the fix belongs in the launch path, not just the reaper.Thanks for preserving the evidence and reproducing it twice — the per-AZ timing was the key that pointed away from the original hypothesis.
refactor(cmd): extract runLaunchBatch to dedup parallel-launch (#320) (…