Repository navigation
Description
Found validating v0.131.0 live (2026-10-17, account 435415984226, us-east-1, released CLI + spored 0.131.0).
Test: persistent --spot t3.micro (--idle-timeout 50m --ttl 1h; request sir-f36qmbej), original i-089f582ef1ba3b4ac terminated outside spawn at 16:15:16Z.
| time (UTC) | event |
|---|---|
| 16:16:49 | EC2 launches replacement i-0d3a7006f2833a22e, 0 tags |
| 16:17:52 | its spored cancels the request (request-canceled-and-instance-running) ✅ |
| 16:18:23 | instance stopped ❌; instanceInitiatedShutdownBehavior = stop |
What #1008 intended: pkg/spotrequest.RetireReplacement "ends a replacement": cancel the request, then an OS shutdown. Its comment reasons about what happens "if EC2 terminates the instance". The design assumes the shutdown terminates. It doesn't: spawn never sets InstanceInitiatedShutdownBehavior (grep -rn InstanceInitiatedShutdownBehavior pkg cmd finds nothing), so EC2's default stop applies.
Result, which is worse than it looks: a stopped, untagged instance whose request is cancelled.
- Nothing will ever start it. A stopped persistent-Spot instance restarts only through its request, and that's now cancelled.
- Nothing will end it. The reaper's
ec2:TerminateInstancesis tag-scoped (TTL reaper cannot terminate an untagged replacement launched by a leaked persistent Spot request #984), so its sweep classifies this as a replacement and reportsSPOT REPLACEMENT NOT TERMINATED(evaluateSpotRequest countsstoppedas live) every 10 minutes until a person acts. It's invisible tospawn list. - Its EBS root volume bills indefinitely.
In fairness, it is strictly better than v0.130.1, where the replacement kept running with no TTL. The relaunch loop is closed (cancel worked within about a minute). What's left is an alarmed storage leak.
Fix options (each needs real-AWS verification; see #1069 for why a simulator pass is not enough):
- Let the instance terminate itself. Grant the instance role
ec2:TerminateInstanceson its own ARN, independent of tags, via the self-reference pattern (Condition: StringEquals aws:ARN = ${ec2:SourceInstanceARN}, or the documented equivalent). That narrows it to "this instance only", which is the property the tag scope approximates. It uses a policy variable, so prove it with a realPutRolePolicyand a real self-terminate before shipping. - Make the OS shutdown terminate. Set
InstanceInitiatedShutdownBehavior=terminatewhere the replacement would inherit it. It's unverified whether a persistent request's launch specification carries this attribute to its replacements at all, and whether it's allowed alongsideInstanceInterruptionBehavior=stop. Check before relying on it. - Fall back loudly. If neither is possible, spored should at least say in its log, and in the
spot_replacement_retirednotification, that the instance is being stopped and still needs terminating, and give the command, not imply it ended.
The test was cleaned up by hand: replacement and original terminated, volume deleted, 0 open/active requests, 0 leaked instances.
Activity
Let a Spot replacement terminate itself instead of being left stopped (…
scttfrdmn commentedon Oct 17, 2026
Verified live on v0.131.1 (released CLI + spored; 2026-10-17, account 435415984226, us-east-1).
Persistent
--spott3.microorphan-r3, requestsir-bw5znqij(ValidUntil= TTL deadline). Originali-03738794bdf728d7eterminated outside spawn at 17:56:16Z.i-03cdf8b294db89047(untagged)CancelSpotInstanceRequestsOK, thenTerminateInstancesOK. CloudTrail principal for both:assumed-role/spored-instance-role/i-03cdf8b294db89047, i.e. the replacement itselfterminated(v0.131.0:stopped)No manual cleanup was needed. Afterwards: 0 leaked instances, 0 open/active Spot requests, 0 available volumes, 0 DNS records. Neither the reaper nor an operator was involved; the leak now closes itself about 30 seconds after the replacement boots.