Repository navigation
Description
Summary
recordLaunchSpotPrice (#896) almost never records spawn:spot-price-per-hour. It calls DescribeInstances right after RunInstances, gets EC2's eventual-consistency InvalidInstanceID.NotFound, and gives up because it never retries. spored then costs every spot instance at the on-demand rate, and spawn status shows both rates in one screen.
Evidence
Live launch, v0.151.0 released CLI, account 942542972736, us-east-1d. The command was spawn launch nopub151 --instance-type c8gn.48xlarge --spot --efa --no-public-ip --ttl 1h --yes --az us-east-1d, and the instance was i-0faa599bdda83e113:
~/.spawn/spawn.log
2026/10/30 07:20:09 note: could not record the spot price for i-0faa599bdda83e113 (describe instance: operation error EC2: DescribeInstances, https response error StatusCode: 400, ... api error InvalidInstanceID.NotFound: The instance ID 'i-0faa599bdda83e113' does not exist); status will show the on-demand rate for it
The instance's tags had no spawn:spot-price-per-hour (spawn:price-per-hour 11.376000 was present).
spawn status then contradicted itself within a single output:
Compute cost: $0.12 (38s billed × $11.3760/hr on-demand (spot price unknown))
Spot rate: unknown — costs above use the on-demand rate, so they overstate
...
Max compute cost: ~$5.59 by deadline at the current spot price (~$11.38 at on-demand)
instance i-0faa599bdda83e113 ~$5.5889/hr c8gn.48xlarge (spot) — current spot price
The CLI's billable section falls back to CurrentSpotPrice, a live lookup. spored's block (statusComputeRate) only has the tag, so it overstates by about 2x here.
How often: this workstation's ~/.spawn/spawn.log has 99 could not record the spot price lines since 2026-10-18, and every one of them is InvalidInstanceID.NotFound:
$ grep "could not record the spot price" ~/.spawn/spawn.log | grep -c InvalidInstanceID.NotFound
99
$ grep -c "could not record the spot price" ~/.spawn/spawn.log
99
Cause (v0.151.0)
pkg/aws/client.go:750callsrecordLaunchSpotPrice(ctx, ec2Client, result.Instances[0])immediately after RunInstances.- In
pkg/aws/spotprice.go,spotPriceForInstancere-describes the instance when the RunInstances result lacksPlatformDetailsor the placement. That re-describe is the call that hits NotFound, and there is no retry. The 10s context leaves room for one.
Fix options
- Retry the
DescribeInstancesonInvalidInstanceID.NotFoundwith a short backoff inside the existing 10s budget. - Or skip the re-describe: the AZ is known from the launch config and subnet, and the product description can come from the AMI's
PlatformDetails(DescribeImages, which has no consistency lag).
Display-only: --cost-limit is enforced against the on-demand price by design, so this overstates and never understates.
Found during the v0.151.0 --no-public-ip multi-card EFA live test.
Activity