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 on Spot instances is enforced at the on-demand rate, and terminates the job without a signal #1497
spawn 0.152.0. spawn launch --spot --cost-limit 7 --ttl 5h ... on c9gd.16xlarge (us-east-1, Spot $1.09/h at launch, on-demand $3.418/h). spored terminated the instance after 2.05 h, i.e. when on-demand rate × compute time reached $7.01. Actual Spot spend was about $2.23. spawn cost --help confirms the estimate is "the on-demand rate (spawn:price-per-hour tag) × its compute time".
Two problems:
A Spot cost limit is ~3× tighter than the user's budget, with nothing at launch saying so. Users naturally size the limit at the Spot price they see.
The job gets no warning. The instance terminated 5 s after the job's last log sync, mid-step: no SIGTERM to the --command process, no grace period, no final log/result upload. A long batch job loses its work and its evidence.
Suggestions:
For Spot instances, track spend from Spot price history (or the price at launch), or at least state at launch: "cost limit is enforced at the on-demand rate $X/h → effective runtime Y h".
On reaching the limit, signal the command (SIGTERM), wait a grace period (configurable, e.g. 2 min), then terminate. Tag the instance with the reason (spawn:terminated-by=cost-limit) so spawn list and CloudTrail show why.
spawn extend --raise-cost-limit is the right escape hatch; mention it in the launch output when the limit < TTL × on-demand rate.
PR #1555 fixes the first half: Spot compute is now counted at the Spot price spored samples, with a labelled on-demand fallback. It needs a live EC2 check before merge, and the plan is in the PR. The second half (no SIGTERM or grace period at the limit, and a terminated-by tag) is split out to #1554, because #1555's Fixes #1497 will close this issue.
Activity
scttfrdmn commentedon Nov 8, 2026
PR #1555 fixes the first half: Spot compute is now counted at the Spot price spored samples, with a labelled on-demand fallback. It needs a live EC2 check before merge, and the plan is in the PR. The second half (no SIGTERM or grace period at the limit, and a
terminated-bytag) is split out to #1554, because #1555'sFixes #1497will close this issue.