Repository navigation
fix: spawn:ttl now tracks the cumulative total, not the raw extend argument - #513
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…gument extend correctly advanced spawn:ttl-deadline (the tag spored and the reaper actually enforce) but rewrote spawn:ttl to the literal <duration> argument each call, so it stopped meaning "total duration from launch" -- what every other reader of the tag expects. A repeated `extend <id> 8h` looked unchanged even though the deadline had genuinely moved twice. stop/hibernate's remaining-TTL preservation computed from spawn:ttl + LaunchTime directly, so it silently ignored any extend calls made since launch -- a stop/start cycle after an extend could restore the wrong TTL. Both call sites now derive remaining TTL from the authoritative spawn:ttl-deadline tag via lifecycleDeadline, same as spawn status already did. Extracted the tag-computation logic into a pure computeExtendedTTLTags so it's unit-testable without a real AWS client. Fixes #506
scttfrdmn
force-pushed
the
fix/506-extend-ttl-tag-semantics
branch
from
August 18, 2026 07:11
c41b383 to
b3efa9d
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.
Summary
spawn extendcorrectly advancedspawn:ttl-deadline(the absolute timestamp spored and the out-of-band reaper actually enforce) but rewrotespawn:ttlto the literal<duration>argument on every call — so it stopped meaning "total TTL duration from launch," which is what every other reader of the tag expects. A repeatedextend <id> 8hlooked unchanged even though the deadline had genuinely moved twice — reported live as "extend rewrites spawn:ttl-deadline and leaves spawn:ttl at the original 8h... two tags for one fact, only one of them moving."This had a real behavioral consequence beyond the confusing display:
spawn stop/hibernate's remaining-TTL preservation computedspawn:ttl + LaunchTimedirectly, silently ignoring anyextendcalls made since launch. A stop/start cycle after an extend would restore the wrong (un-extended) TTL.Fix
spawn:ttlis now recomputed asnewDeadline - LaunchTime— the actual cumulative total — instead of echoing the raw extend argument.spawn stop/hibernate's remaining-TTL calculation (both the single-instance and job-array paths) now derives from the authoritativespawn:ttl-deadlinetag via the existinglifecycleDeadlinehelper, same asspawn statusalready did, instead ofinstance.TTL + LaunchTimedirectly.runExtendinto a purecomputeExtendedTTLTagsfunction so it's unit-testable without a real AWS client.spawn extend's own output now separates "Extended by" (the argument) from "New TTL" (the resulting cumulative total) and the resolved deadline, instead of one ambiguous "New TTL" line that showed the raw argument.Fixes #506.
Test plan
TestComputeExtendedTTLTags_DeadlineAdvancesAndTTLTracksTotal(also asserts a second extend visibly changesspawn:ttlagain),TestComputeExtendedTTLTags_FloorPreventsImmediateReap,TestComputeExtendedTTLTags_NoDeadlineTagFallsBackToTTL,TestLifecycleDeadline_ReflectsExtendNotJustLaunchPlusTTLspawn:ttlfix (reverted just that line, confirmedFAIL) and passes with itgo build ./...,go vet ./...,go test ./cmd/...all cleangolangci-lint run ./cmd/...— no findings in touched filesmake gen-docs— no drift (only runtime output changed, not flag/help text)CHANGELOG.mdupdated under## [Unreleased]