Skip to content

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

Closed

Description

@scttfrdmn

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

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:

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

Versions

spawn v0.62.0, lagotto v0.47.0. Re: closed #210 / #213.

Activity

  1. added
    bug
    on Jun 18, 2026
  2. scttfrdmn commented on Jun 18, 2026

    @scttfrdmn
    ContributorAuthor

    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.

  3. scttfrdmn commented on Jun 18, 2026

    @scttfrdmn
    ContributorAuthor

    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.

    spawn v0.62.0, lagotto v0.47.0.

  4. scttfrdmn commented on Jun 24, 2026

    @scttfrdmn
    ContributorAuthor

    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.

  5. scttfrdmn commented on Jun 24, 2026

    @scttfrdmn
    ContributorAuthor

    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:

    So on the path whose log line is provision: launch: ... InsufficientInstanceCapacity — that's client.Launch erroring, 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:

    1. 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: ....
    2. Binary provenance — if any cycle ran older code, that'd explain the pre-launcher.Provision: create ephemeral FSx AFTER a successful RunInstances (eliminate create/teardown churn on capacity-failed launches) #213 pattern; you've indicated it was the released binary, so I'm treating (1) as the leading hypothesis.

    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.

  6. scttfrdmn commented on Jun 24, 2026

    @scttfrdmn
    ContributorAuthor

    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 RunInstances failure creates zero FSx — confirmed in 942542972736/us-west-2).

    Actual root cause (proven live): a post-launch failure. When RunInstances succeeded 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):

    • Before: forced post-launch FSx failure → instance i-0f5c… left running (orphaned).
    • After: same scenario → Provision auto-terminated i-0fe9…; leak-check clean (zero instances, zero FSx).

    Fix (two parts):

    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.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions