Skip to content

sweep resume drops the sweep's CLI --ttl/--idle-timeout/--cost-limit and skips the 1h idle default; a resumed member can run with no lifetime bound #1394

Closed

Description

@scttfrdmn

Found while fixing #1385 (same root cause: the sweep checkpoint records only the param-file path, and resume reloads the file).

Evidence (code, origin/main a79f4b3):

  • applyCLISpendControlsToSweep (cmd/launch_sweep.go ~L1057-1065) writes CLI --ttl, --idle-timeout and --cost-limit into the in-memory paramFormat.Defaults only. SweepState (cmd/sweep.go) does not record them.
  • runResume (cmd/resume.go) re-parses state.ParamFile from disk and builds each pending member with buildLaunchConfigFromParams(aws.LaunchConfig{}, paramFormat.Defaults, ...). The CLI values are gone.
  • The 1h idle-timeout default (applyIdleTimeoutDefault, via defaultSweepMember) is applied on the foreground and detached launch paths (cmd/launch_sweep.go:343, cmd/launch_sweep_detached_bootstrap.go:142), but runResume never calls either. grep -rn "applyIdleTimeoutDefault(\|defaultSweepMember(" cmd pkg lists no resume caller.

So a sweep launched as spawn launch --param-file p.yaml --ttl 4h (no ttl: in the file) and later resumed launches its pending members with no TTL, no idle timeout and no cost limit. The existing comment at cmd/resume.go (#1375: "Resume rebuilds each row from the file alone (no --instance-profile, no --ttl)") already acknowledges this for the nested-role case.

Not reproduced against AWS. Cost: a resumed member has no in-instance lifetime bound; only the out-of-band reaper backstop remains.

Suggested fix: record the CLI spend controls in the checkpoint as #1385 does for IAM (IAMRecorded/IAMRole pattern), re-apply them on resume, and call defaultSweepMember/applyIdleTimeoutDefault for each pending member; for checkpoints without the record, at minimum apply the 1h idle default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component:spawnlifecyclespend-safetytype:bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions