Repository navigation
fix: app launch 8h default TTL; service and pool workers terminate on idle; truthful idle wording - #1200
Merged
Conversation
This was referenced Oct 19, 2026
Closed
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
scttfrdmn
added a commit
that referenced
this pull request
Oct 19, 2026
…-cost-limit Pool workers now write the completion record on a clean drain (and a failed one when they exhaust restarts), so on_complete=terminate fires. Worker.Run drains at once when its queue is deleted and honours its idle deadline on the claim-error path. Builds on #1200's TerminateOnIdle for spored's own idle action. pool drain reports 'already drained' and exits 0 on a missing queue. pool create gains a per-worker --cost-limit. Fixes #1146 Fixes #1183
…le; truthful idle wording spawn app launch sets an 8h TTL when --ttl is not given and refuses an empty one (#1150). spawn service and pool workers set the new LaunchConfig.TerminateOnIdle (spawn:terminate-on-idle), so spored terminates them when idle instead of stopping them (#1151, refs #1146). Help and notices that said idle terminates on stop paths are corrected, and a gate walks the command tree for idle-terminate claims (#1132).
scttfrdmn
force-pushed
the
fix/1150-1151-app-service-lifecycle
branch
from
October 19, 2026 23:25
322f58a to
b793afc
Compare
scttfrdmn
added a commit
that referenced
this pull request
Oct 20, 2026
…-cost-limit Pool workers now write the completion record on a clean drain (and a failed one when they exhaust restarts), so on_complete=terminate fires. Worker.Run drains at once when its queue is deleted and honours its idle deadline on the claim-error path. Builds on #1200's TerminateOnIdle for spored's own idle action. pool drain reports 'already drained' and exits 0 on a missing queue. pool create gains a per-worker --cost-limit. Fixes #1146 Fixes #1183
scttfrdmn
added a commit
that referenced
this pull request
Oct 20, 2026
…imit (#1146, #1183) (#1192) * fix: app launch default TTL; service and pool workers terminate on idle; truthful idle wording spawn app launch sets an 8h TTL when --ttl is not given and refuses an empty one (#1150). spawn service and pool workers set the new LaunchConfig.TerminateOnIdle (spawn:terminate-on-idle), so spored terminates them when idle instead of stopping them (#1151, refs #1146). Help and notices that said idle terminates on stop paths are corrected, and a gate walks the command tree for idle-terminate claims (#1132). * fix(pool): workers terminate when drained; drain is idempotent; add --cost-limit Pool workers now write the completion record on a clean drain (and a failed one when they exhaust restarts), so on_complete=terminate fires. Worker.Run drains at once when its queue is deleted and honours its idle deadline on the claim-error path. Builds on #1200's TerminateOnIdle for spored's own idle action. pool drain reports 'already drained' and exits 0 on a missing queue. pool create gains a per-worker --cost-limit. Fixes #1146 Fixes #1183
This was referenced Oct 20, 2026
Merged
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 #1150
Fixes #1151
Fixes #1132
Refs #1146
What changed
App launch default TTL (#1150).
spawn app launch --ttlnow defaults to8h(the owner's decision), so the default shows up in--help, and it flows into the launch config as before (TTL: appLaunchTTL). An explicitly empty--ttl ""is refused before any AWS client exists. The TTL is printed at launch (TTL: 8h (default; ...)) and in both ready summaries. Idle still stops, so a session can be restarted.app launchhas no--no-timeout, and this PR does not add one: a session that needs longer passes a longer--ttlor runsspawn extend.Service idle → terminate (#1151). New
aws.LaunchConfig.TerminateOnIdle, written asspawn:terminate-on-idle=true. spored reads it (provider.Config.TerminateOnIdle), andidleTimeoutReachedthen terminates instead of stopping. It wins over hibernate.spawn servicesets it. A Spot launch whose idle action is terminate stays a one-time request, since it no longer needs a stoppable one.spawn statusandspored statussay "terminates". The service dry-runLifetime:line names the idle action.Pool workers idle → terminate (refs #1146). Same mechanism, set in a new pure
poolWorkerBaseConfig. This makes "Workers self-terminate on idle-timeout" true. It does not address #1146 item 2 (workers spinning afterpool draindeletes the queue), so #1146 stays open.Wording (#1151, #1132). The zombie-guard notice and the sweep's equivalent used to say "terminate" on every path. They now name the real action: stop, hibernate, or terminate. Corrected:
launch --idle-timeout,--active-portsand--active-processes,burst --idle-timeout(burst still stops),app,defaults("Hibernate instead of stopping on idle"), and thenotify workspace addexample plus two error messages that namedworkspace-add.No new notification event: an idle terminate sends none. spore-bot has no
idle_terminatedmessage, and adding one is cross-repo. Users logged in to the instance still get spored's terminate warning.Gates (each watched failing against a revert that compiles, with
go vetclean)TestIdleTerminateClaimsAreTruewalks the whole cobra tree (Short/Long/Example/flag usages) with i18n initialised andupdateCommandDescriptionsapplied explicitly, so the result doesn't depend on test order. Any clause that mentions idleness and termination is a claim. The command making it must be inidleTerminateProofs, whose entry calls the command's real config builder, and that builder must setTerminateOnIdle. Fails on: serviceTerminateOnIdle: false, poolfalse, the olddefaultstext, the oldbursttext, the oldlaunch --idle-timeouttext. Strings thatupdateCommandDescriptionstakes from spore-host/libs are discovered from its source and excluded. They're logged, not judged, because they live in another repo (see the follow-up issue).TestIdleTerminateClaimMatcherpins the matcher against the shipped shapes, and checks it doesn't fire on the TTL-plus-idle-default sentences.TestIdleDefaultNoticeNamesTheRealActionruns throughguardZombieInstance. Fails on a hardcoded "terminate" notice and on serviceTerminateOnIdle: false.TestAppLaunchAlwaysHasATTLchecks the flag default and runsrunAppLaunchwith--ttl ""/" ". Fails on a""default, and on removing the refusal (with the AWS env pointed at 127.0.0.1:1, so a regression can't reach a real account).TestIdleActionHonoursTerminateOnIdle(pkg/agent),TestBuildTags_TerminateOnIdleandTestSpotRequestType_TerminateOnIdleIsOneTime(pkg/aws),TestConfigFromTags_TerminateOnIdle(pkg/provider), plus newTestIdleActionDescriptioncases. Each fails on its revert.Checks
make check: steps 1-6 pass. Step 7,check-build-tags, fails identically on unmodified main on this machine (/private/tmppaths).make check-docs: clean aftermake gen-docs.make api-snapshot: one addition,field LaunchConfig.TerminateOnIdle bool.semgrep scan --config=auto --error .: 0 findings.Not verified on AWS. spored only picks up the new tag once it ships in a release (spored is release-only). Until then an older spored ignores the tag and stops as before.