Repository navigation
fix(extend): keep the cost limit unless asked; warn when it fires first (#1262) - #1281
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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 #1262
Root cause
The issue blamed
spored reload, but that never reaches the daemon (#1278). The real cause isspawn extenditself. Since #639, its default was to raisespawn:cost-limitto whatever the new deadline needed (decideCostLimit).In #1262, each c8gn.48xlarge ($11.376/hr) had
--ttl 2h --cost-limit 25and was extended by 1h twice. That raised the cap to about $34, then about $46. The instances ran 152–158 min (about $29) and were terminated by hand before reaching the raised cap. This accounts for every timestamp in the report.extenddid printCost limit: $25 → $…, but that is easy to miss across 8 boxes.The other suspect was a missing
spawn:price-per-hoursilently disabling enforcement. That is ruled out for this case: a Linux launch with--cost-limitand no known price is already refused at launch (resolvePricePerHour).Change (owner decision: never raise, warn)
extendprints aspawn extend <id> 1m --cost-limit Nthat includes the extra minute. This covers 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 #639's real complaint: the instance died early and nobody said why.--raise-cost-limitis new and restores 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 #639's raise.--cost-limit Nstill sets a value.--keep-cost-limitis now the default. It is deprecated, but scripts that pass it still work.--cost-limitwith--raise-cost-limit, or--keep-cost-limitwith either.Gates
TestExtendKeepsTheCostLimitByDefaultuses the reporter's numbers. It checks that the cap is not moved and thatBindsis set. It requiresFiresAtto be about launch+132m, allowing up to 5 min early (thecompute-secondstag lag) and never late. It also requires the warning text and the suggested command.TestJobArrayExtendKeepsEachCostLimitByDefaultcovers the same behaviour on the job-array path. It asserts no tag is written and the warning appears.if raise || true).raise=true.TestCheckExtendCostLimitFlagscovers the flag combinations.Checks run
go test -short ./...: pass.make lint: clean in all 10 modules.make gen-docs: regenerateddocs-gen/extend.md.No dependent repos call
extend's cost-limit flags. I checked spore-host-mcp and the adapters.