Skip to content

A box too small to run spored cannot enforce its own TTL: 0.5 GiB instance outlived a 6m TTL by 2x, silently #682

Closed

Description

@scttfrdmn

Reported by the snakemake adapter's beta tester in snakemake-executor-plugin-spawn#16, with console evidence. Filing it here as they framed it — an observation with evidence, not a confident TTL bug claim — because the box was in a state nothing is promised for.

What was observed

  • t4g.small-class probe, actually sized to t4g.nano (0.5 GiB), TTL 6m
  • The job wedged during a Docker install: console shows Amazon Linux 2023 repository 56 MB/s | 80 MB, then Waiting for process with pid 2213 to finish, then nothing
  • At 12 minutes — double the TTL — the instance was still running
  • No completion.json and no command.log in the results prefix
  • Force-terminated by hand

The likely reading, and why it is not surprising

spored enforces TTL, idle and cost limits in-instance. A box too degraded to make progress under dnf on 0.5 GiB is also too degraded to run its own enforcement loop — so the mechanism that should have killed it is the mechanism that was starved. This is the same constraint #640 names for FSx, and it is the stated reason the out-of-band reaper exists at all (the lifecycle invariant: "lifetime is enforced in-instance by spored, so it needs an out-of-band reaper backstop").

So I do not think this is a defect in the TTL logic. It is the in-instance enforcement model meeting its documented limit, demonstrated live.

Why it is still worth an issue

Three things this sharpens:

  1. It is the cleanest real-world demonstration of why the reaper is not optional. Until now the argument for the backstop has been structural. Here is an instance that outlived its TTL by 2× in an account with no reaper, and the only thing that stopped the bill was a human noticing. Worth citing in the reaper docs.
  2. Nothing warned. From the outside this is indistinguishable from a long-running job. There is no signal that spored never reached its ticker, which is the spored#65 shape (never block the ticker startup path) in a new guise — not blocked by code this time, but starved by the box. A spored-has-not-checked-in signal would make this visible; today the absence of a heartbeat is silent.
  3. It argues for a floor. The adapter side is snakemake-executor-plugin-spawn#18 (don't size a container job onto 0.5 GiB). The spawn side is whether spawn should refuse, or warn about, an instance type too small to run spored plus whatever the launch is also asking it to install. There is a precedent for failing closed here — --mpi on a non-cluster-capable type is refused up front, before spending.

What I am NOT claiming

That TTL is broken. On the same reporter's 4 GiB runs everything behaved: correct non-zero exit codes in completion.json, full command.log, and self-termination on on_complete without intervention. The failure is specific to a box with too little memory to function.

Suggested next step

Not a code change yet — a decision on (2) and (3). My inclination: a minimum-viable-instance guard (refuse or warn, following the --mpi precedent) is cheap and prevents the class; a spored heartbeat is a bigger piece of work but is the only thing that makes a starved instance visible rather than merely preventable. Both are properly part of the "who reaps the reapers" thread rather than a quick fix here.

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