Skip to content

Nothing warns when an account has no TTL-reaper coverage, so the 'everything dies eventually' invariant silently doesn't hold #624

Closed

Description

@scttfrdmn

Raised out of #613, where a 1.2 TiB ephemeral FSx and a TTL-expired instance both survived in an account that no reaper scans. #617 fixed the wording that promised otherwise; this is the missing check.

The gap

Instance lifetime has two enforcers: spored in-instance (primary) and the out-of-band ttl-reaper Lambda (backstop). The backstop only covers accounts it is explicitly configured to scan — REAPER_SCAN_SELF for its own account, REAPER_ROLE_ARNS for others (lambda/ttl-reaper/main.go, resolveAccounts).

Nothing tells a user which case they're in. spawn launch behaves identically in a covered and an uncovered account. The design invariant — "everything dies eventually; TTL always terminates" — quietly degrades to "TTL terminates if spored stays healthy", and #613 plus spored #65/#66 are the record of spored not staying healthy.

The codebase already knows. Two comments say so and neither is reachable by a user as a warning:

cmd/launch_flags.go:253   "...easy to forget in accounts without a hosted reaper"
cmd/fsx_lease.go:76       "...only in accounts the reaper is configured to scan"

Why silence is the wrong default here

The uncovered cases are exactly the expensive ones, because they're the ones spored can't reach:

  • A stopped instance runs no daemon at all, so only the reaper will ever reclaim it. Live example from --fsx-lifecycle ephemeral did not reap the filesystem when the instance terminated (1.2 TiB left AVAILABLE and billing) #613's account: a spawn:managed=true c5.4xlarge, stopped, TTL expired 9 days earlier, still billing its EBS volume.
  • An ephemeral FSx whose instance is already gone has no in-instance owner by definition — the reaper is the only thing that deletes it. 1200 GiB is the FSx Lustre floor, so the cost floor is ~$174/month.
  • --on-complete stop leaves EBS and any attached EIP billing indefinitely; its own flag help admits this is "easy to forget in accounts without a hosted reaper".

And spawn orphans reports clean in that state:

$ spawn orphans --region us-east-1 --all
No orphaned spawn-managed resources in us-east-1.

…with the 9-day-expired instance sitting in that region. Its definition of "orphan" is detached things — available volumes, unattached security groups, unassociated EIPs — so a TTL-expired instance isn't counted, its volume is in-use rather than available, and grep -c fsx cmd/orphans.go is 0. So the one command whose job is finding leaks confirms there are none.

Ask

1. Make coverage a first-class, checkable fact in spawn doctor. It's locally detectable without guessing: coverage exists if either a reaper function runs in this account (scan-self), or the conventional cross-account role — spawn-ttl-reaper-ec2, per lambda/ttl-reaper/README.md:93 — exists here trusting a reaper elsewhere. doctor should report covered / not covered / can't tell, and say what the consequence is rather than just the status.

2. Warn at launch when the launch depends on the backstop and the backstop may be absent. Not on every launch — only where it changes the outcome: --on-complete stop, --fsx-lifecycle ephemeral, and long TTLs. Cache the determination so it isn't an IAM call per launch, and make it suppressible for users who know (--no-reaper-warning or config), since a warning that can't be silenced gets ignored.

3. Say it in the docs next to the invariant, so "everything dies eventually" is stated with its precondition instead of as an unconditional guarantee.

Deliberately not in scope

Making an uncovered account covered — that's the self-hosted deploy path, filed separately. This issue is only about not being silent, and it's worth doing independently, since a user who can't or won't run a reaper still deserves to know the backstop isn't there.

Refs #613, #615.

Activity

  1. scttfrdmn commented on Oct 2, 2026

    @scttfrdmn
    ContributorAuthor

    Fixed in #631 (merged as `e9d8840`) — the visibility half. #625 remains open and is the half that makes an uncovered account fixable rather than merely knowable.

    Correction to my own issue text

    I wrote this up as "nothing warns." Something did: `spawn doctor` has had a "TTL reaper backstop" check all along. The real defect was worse — `ReaperConfigured` was a hardcoded `return "", fmt.Errorf("not detected from this account …")`, so it printed the same warning in every account, covered or not. It carried no information, and a warning that always fires is one people learn to scroll past. An account where nothing reclaims expired instances read identically to a healthy one, which is how that `spawn:managed` instance sat stopped 13 days past its TTL while doctor said its usual line.

    The code's stated reason was that a launch account cannot see a reaper living elsewhere. That turned out to be wrong.

    Coverage is detectable, and now detected

    Two local signals, neither of which anything else creates:

    1. a reaper Lambda running in this account (`REAPER_SCAN_SELF`)
    2. the conventional `spawn-ttl-reaper-ec2` role, which exists only because an operator granted a reaper elsewhere access

    Validated against three real accounts before any code was written, and then with the shipped build:

    ```console
    $ spawn doctor # infra account
    ✓ TTL reaper backstop: in-account reaper spawn-ttl-reaper-production

    $ spawn doctor # a spore-launching account
    ✓ TTL reaper backstop: cross-account role spawn-ttl-reaper-ec2

    $ spawn doctor # the account with the 13-day orphan
    ⚠ TTL reaper backstop
    → no reaper runs in this account and no spawn-ttl-reaper-ec2 role grants one access —
    TTL is enforced only from inside the instance by spored, which cannot act on a
    STOPPED instance and does nothing if it dies
    ```

    "Could not determine" is now distinct from "there is none." If a probe cannot complete, the check says so rather than asserting an absence it has no basis for — the old code made that claim regardless.

    The launch warning is narrower than this issue asked for, deliberately

    It fires only where coverage changes the outcome:

    A plain `--on-complete terminate` stays silent. `spored` handles that from inside and the reaper is only its backstop, so warning there would rebuild precisely the noise this change removes. I dropped the "long TTL" trigger from the original ask for the same reason — a long TTL is a choice, not a gap.

    It warns before anything is spent, including under `--dry-run` and `--estimate-only`, since those are the "what would this cost me" surfaces.

    Also now in `docs/durable-storage-fsx.md`: how to check coverage, and what the invariant actually promises — two layers, degrading to "whatever spored manages" in an uncovered account.

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