Repository navigation
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…writers (#983) The job-array path of `spawn extend` wrote only spawn:ttl=<raw argument>. spored and the TTL reaper enforce spawn:ttl-deadline, so it reported success and moved nothing. Each array instance now goes through extensionTags, the same function the single-instance path uses (computeExtendedTTLTags plus the #639 cost-limit decision), so the two paths cannot drift. Audit of every other spawn:ttl writer: `spawn start` (single and job-array) "restored" spawn:ttl-remaining into spawn:ttl without the deadline. That changed nothing enforced, corrupted the total-from-launch meaning, and shortened the TTL on pre-deadline instances. Start no longer rewrites the TTL and tells the user the deadline still applies, which matches the documented fixed-deadline design (#928). launch's conditional deadline is filed as #990, and the LaunchTime-anchor problem as #992. TestEveryTTLTagWriterAlsoWritesTheDeadline parses every non-test .go file and fails when a declaration writes spawn:ttl without writing or deleting spawn:ttl-deadline. There is no allowlist. It fails on origin/main (extendJobArrayWithAudit, runStart, startJobArray). Fixes #983 (#983)
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 #983
What was wrong
spawn extend --job-array-*wrote onlyspawn:ttl=<raw arg>. spored and the TTL reaper enforcespawn:ttl-deadline, which it never touched. The command printed "Job array TTL extended!" and every instance still died at its original deadline.Changes
extensionTags. That function iscomputeExtendedTTLTagsplus the spawn extend moves the TTL but not the cost limit, so it is a no-op on any task whose cap was sized to its TTL #639decideCostLimit, and the single-instance path now calls it too, so there is one implementation. Per instance, the deadline moves forward from that instance's own deadline andspawn:ttlstays the total from launch (extend: spawn:ttl tag is overwritten with the extend argument, not the cumulative total — every other reader still treats it as the launch-anchored duration #506). The cap is raised when it would fire first, and--cost-limit/--keep-cost-limitare honoured. The old "extend capped instances individually" warning is gone. A duration thattime.ParseDurationrejects now fails before anything is written.spawn:ttlwriters:spawn start(single and job-array) "restored"spawn:ttl-remainingintospawn:ttland left the deadline alone. That moved nothing enforced and corrupted the tag's meaning. On a pre-deadline instance it also shortened the TTL. Start no longer rewrites the TTL. It now prints that the TTL does not pause and shows the enforced deadline, which matches the fixed-deadline design (Stopped instances: 'spawn status' SSHes to ::1 (localhost) and fails; compute from earlier runs is dropped after restart; stop message says TTL pauses but it doesn't #928 covers thespawn stopmessage).pkg/aws/tags.go buildTagswrites the deadline only whentime.ParseDurationsucceeds, so--ttl 1dgets no deadline. Filed as spawn launch --ttl 1d writes spawn:ttl=1d with no spawn:ttl-deadline, so neither spored nor the reaper enforces the TTL #990.extendanchors to EC2 LaunchTime, which resets on start. Filed as spawn extend anchors spawn:ttl and the raised cost limit to EC2 LaunchTime, which resets on every start #992.pkg/ttl.Tags,computeExtendedTTLTagsandspored config set ttl(which deletes the deadline for0) already write or remove both tags.TestEveryTTLTagWriterAlsoWritesTheDeadline(root package): parses every non-test.gofile, nested lambda modules included. It finds structural writes of the tag (map-literal key, assigned index,types.Tag{Key: aws.String(...)}), in both the literal and thetagprefix.Tag("ttl")spellings. It fails when a top-level declaration writesspawn:ttlwithout writing or deletingspawn:ttl-deadline. There is no allowlist, and it fails if discovery finds nothing.TestTTLWriterDetectorShapespins the detector.Evidence
origin/maincheckout fails withextendJobArrayWithAudit,runStartandstartJobArray.{"spawn:ttl": newTTL}, start re-adds the write) fails withjobArrayTagUpdaterandrunStart.TestJobArrayExtendMovesEachInstancesDeadlineandTestJobArrayExtendRaisesEachInstancesCostLimitfail too.make check: the only failure is the known Docker-onlyTestGenerateWrapper_ChownFixesCrossUIDStickyUnlink_Docker.make check-nested: all 9 nested modules clean.