Repository navigation
fix(sweep): resume keeps the sweep's --ttl/--idle-timeout/--cost-limit and lifetime flags (#1394) - #1403
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…t and lifetime flags (#1394) New checkpoints record the CLI lifetime settings; resume re-applies them, applies the launch defaults to old checkpoints, refuses a member with no bound or a weaker one than the original, and gains --ttl/--idle-timeout/ --cost-limit overrides (refused with --detach).
scttfrdmn
force-pushed
the
fix/1394-resume-keeps-lifetime
branch
from
October 28, 2026 22:13
ee8ee22 to
c67a5b9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1394
A resume rebuilt each pending sweep member from the param file and an empty base config, so the sweep's
--ttl,--idle-timeoutand--cost-limit(and--on-idle,--no-timeout, the completion/session settings) were dropped, and the 1h idle default was never applied. A resumed member could run with no lifetime bound.Recorded. New checkpoints carry
lifetime(SweepLifetime): ttl, idle_timeout, cost_limit, hibernate_on_idle, no_timeout, on_complete, completion_file, completion_delay, session_timeout, idle_cpu_percent. These come from the sweep's base config (newSweepLifetime(baseConfig, noTimeout)). A resume uses them as the base config and folds ttl/idle/cost into the defaults, the same way the launch does (foldSpendControls, now shared withapplyCLISpendControlsToSweep). A row's own value still wins. A detached sweep needs no new record: the orchestrator relaunches from the params uploaded at launch, and each member's rendered tags and user data there already carry the bounds.Old checkpoints (no
lifetime) get the launch defaults: the row's own bound, else the 1h idle default (applyIdleDefault). Fresh launches have no default TTL. A notice explains how to pass--ttl.New flags on
spawn sweep resume/spawn resume:--ttl,--idle-timeout,--cost-limit. They replace the recorded values but may only tighten them. If a resume would lengthen a TTL or idle timeout, raise a cost limit, or drop any of them (including the 1h idle default a recorded sweep relied on), it is refused before launch. A member left with no bound at all (a--no-timeoutsweep whose row sets none) is refused inlifetime.members(before AMI, key or IAM work), and again by a backstop inrelaunchPending. The refusal message says to pass--ttl. With--detachthe three flags are refused rather than silently ignored.Gates (
cmd/resume_lifetime_test.go). Each one was watched failing against a revert that compiles:--ttl 4h --idle-timeout 30m --cost-limit 5 --on-idle hibernateon launch config and tags, row ttl still wins. Reverts tried: noLifetimein the checkpoint, and the plan ignoring the record.--detachrefuses the flags. Reverts tried: fold drops ttl, and the refusal disabled.--detachrefusal comes beforeresumeSweepDetached, and runResume never callsbuildLaunchConfigFromParamsdirectly.Two fixtures from #1385's tests (
resume_iam_test.go,resume_indices_test.go) now have a TTL, becauserelaunchPendingrefuses unbounded configs.make check,make lint(0 issues),semgrep --error,gen-docs/check-docsall clean. No exported pkg symbols changed. No AWS calls, and no new IAM permissions.Follow-up: #1400 (resume still drops all other CLI flags: --pre-stop, --tag/--team, network, storage).