You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--cost-limit did not fire: on-demand c8gn.48xlarge with --cost-limit 25 ran ~$29 (after spawn extend + spored reload) #1262
Seen: scttfrdmn/adit G2 rerun, us-east-2a, 2026-10-20. spawn was built from the #1206 branch.
Setup: 8 on-demand c8gn.48xlarge launched with --ttl 2h --cost-limit 25. The Price List on-demand rate is $11.376/hr, so the hard kill should fire at about 132 min.
What happened:
Run time: each instance ran 152.5–157.8 min (launch 21:13:59–21:18:04Z, user-initiated terminate 23:50:35–23:51:54Z). That is about $28.9–29.9 of compute each, above the limit.
No kill: no cost-limit termination fired on any of them.
Possibly relevant: I extended every box twice with spawn extend <box> 1h, about 22:01Z and 23:25Z, each time followed by spawn connect <box> -- sudo spored reload. This is what spawn's own guidance says for Ubuntu.
Hypothesis, not verified:spored reload restarts spored's spend accounting (its runtime clock), so accrued cost resets on each reload and never reaches the limit. If so, a cost-limit is not a hard ceiling for any box whose TTL is extended. The expected behaviour is that accrued cost persists across reloads and extends.
A likelier suspect: enforcement is silently off without a price. The check is gated on a.config.CostLimit > 0 && a.config.PricePerHour > 0 (pkg/agent/agent.go:754). If spawn:price-per-hour was missing or 0, for example because a price lookup for c8gn.48xlarge failed at launch, --cost-limit 25 was accepted and never enforced, with no warning. That would also explain the ~$29.
To confirm on a repro: check the instance's spawn:price-per-hour tag, and whether spored status reports the cost limit as active. Separately from the root cause, a cost limit that cannot be enforced should fail at launch, or at least warn, rather than doing nothing silently.
Root cause found, and it corrects my earlier comment. spawn extend raised the cap. Since #639, extend by default raised spawn:cost-limit to whatever the new deadline needed. Each box had a 2h TTL and a $25 cap at $11.376/hr. Extending by 1h twice moved the deadline to 4h, and the cap went to about $34 and then about $46. The boxes were terminated by hand at about $29, before reaching it. Each extend printed Cost limit: $25.0000 → $….
The price-tag theory in my earlier comment does not apply: a Linux launch with --cost-limit and no known price is already refused at launch. spored reload does not reach the daemon either (#1278).
Fix in #1281, per the owner's decision. extend now keeps the cost limit. When the kept cap will terminate the instance before the new deadline, extend warns: it gives about when, what running to the deadline would cost, and the exact --cost-limit command to allow it. --raise-cost-limit restores the old raise. Targeted for the next release.
Activity
scttfrdmn commentedon Oct 23, 2026
Two notes from reading the code (main, e45e1b9). No live repro yet.
spored reloadnever reaches the running daemon: it reloads a throwaway agent in its own process (now spored reload never reaches the running daemon: it reloads a throwaway agent in its own process #1278). The compute base is persisted in a tag (pkg/agent/agent.go:1033), so nothing resets the cost clock.a.config.CostLimit > 0 && a.config.PricePerHour > 0(pkg/agent/agent.go:754). Ifspawn:price-per-hourwas missing or0, for example because a price lookup for c8gn.48xlarge failed at launch,--cost-limit 25was accepted and never enforced, with no warning. That would also explain the ~$29.To confirm on a repro: check the instance's
spawn:price-per-hourtag, and whetherspored statusreports the cost limit as active. Separately from the root cause, a cost limit that cannot be enforced should fail at launch, or at least warn, rather than doing nothing silently.scttfrdmn commentedon Oct 24, 2026
Root cause found, and it corrects my earlier comment.
spawn extendraised the cap. Since #639,extendby default raisedspawn:cost-limitto whatever the new deadline needed. Each box had a 2h TTL and a $25 cap at $11.376/hr. Extending by 1h twice moved the deadline to 4h, and the cap went to about $34 and then about $46. The boxes were terminated by hand at about $29, before reaching it. EachextendprintedCost limit: $25.0000 → $….The price-tag theory in my earlier comment does not apply: a Linux launch with
--cost-limitand no known price is already refused at launch.spored reloaddoes not reach the daemon either (#1278).Fix in #1281, per the owner's decision.
extendnow keeps the cost limit. When the kept cap will terminate the instance before the new deadline,extendwarns: it gives about when, what running to the deadline would cost, and the exact--cost-limitcommand to allow it.--raise-cost-limitrestores the old raise. Targeted for the next release.fix(extend): keep the cost limit unless asked; warn when it fires fir…