Skip to content

Lifecycle Events ​

Spored emits lifecycle events when significant things happen to a running instance. spored logs each event. Completion and Spot interruption can also be posted to a webhook you run; routing events to chat (Slack, Teams, Discord) through spore-bot is experimental and not part of 1.0.

Event types ​

EventWhen it firesDefault message
ttl_warning5 minutes before TTL expiresâąī¸ name terminates in 5 minutes
ttl_expiredAt TTL expiry🔴 name has terminated — scheduled end time reached
idle_warning5 minutes before idle timeout💤 name will stop in 5 minutes — no activity detected
idle_stoppedAt idle timeout (default)âšī¸ name has stopped — idle timeout reached
idle_hibernatedAt idle timeout with --on-idle hibernate💤 name has hibernated — idle timeout reached
idle_stop_failedThe idle stop or hibernate failed; the instance is still running and spored retries with backoffâ„šī¸ name: idle_stop_failed
completionWhen spawn:completion-file is detected✅ name has completed
completion_stop_failedThe on-complete stop or hibernate failed; spored retries with backoffâ„šī¸ name: completion_stop_failed
spot_interruptOn Spot interruption noticeâš ī¸ name received a Spot interruption notice
spot_replacement_retiredA replacement launched from a leaked Spot request was found and terminated (sent to the original instance's users)â„šī¸ name: spot_replacement_retired
pre_stop_startWhen pre-stop hook begins🔄 name is running its shutdown task before terminating
pre_stop_failedThe pre-stop hook exited with an error🟠 name shutdown task FAILED — output may NOT have been saved
pre_stop_timeoutThe pre-stop hook ran past spawn:pre-stop-timeout🟠 name shutdown task TIMED OUT — output may be incomplete
fsx_mount_failedThe FSx filesystem could not be mountedâ„šī¸ name: fsx_mount_failed
fsx_dra_failedThe FSx data repository association (S3 link) could not be set upâ„šī¸ name: fsx_dra_failed
region_vacatedWhen an instance terminates and no other spawn-managed instance was running or pending in the region when the termination was decided, nor just before it terminatesâ„šī¸ name: region_vacated

Events the bot has no dedicated message for are delivered in the generic â„šī¸ form.

An instance tagged spawn:terminate-on-idle (a spawn service instance, a pool worker or a spawn burst member) is terminated at its idle timeout, not stopped, and that sends no event yet (spawn#1205). Users logged in to it still get spored's terminate warning. A cost-limit warning is not an event: at 90% of spawn:cost-limit, spored warns logged-in users with wall and writes /tmp/SPAWN_WARNING.

Receiving events ​

  • spored log: every event is reflected in /var/log/spored.log (spawn logs <name> --which spored).
  • Your own webhook: --completion-webhook-url and --spot-webhook-urlPOST a fire-once notice for completion and spot_interrupt.
  • Chat (experimental, not part of 1.0): with a self-hosted spore-bot, set --slack-workspace at launch (plus --notify-platform teams or discord) and subscribe with /spore notify <nickname>. Without a subscription, events go to the channel webhook (if configured) but not as DMs. The hosted spore-bot is decommissioned.

See Lifecycle Notifications.

Warning thresholds ​

The 5-minute warning is fixed. If you need to respond (extend TTL, save work), you have that window. The warning fires once — subsequent checks within the same warning window don't re-trigger it.

Completion events ​

The completion event fires when spored detects the file at spawn:completion-file (default: /tmp/SPAWN_COMPLETE, or the path you gave --completion-file). After the delay specified by spawn:completion-delay (default: 30s), it executes the action in spawn:on-complete.

A --command (or --mpi-command, on every member) writes the file itself when it exits, pass or fail, so you don't need to. It writes the path --completion-file names, creating its directory if needed (since spawn v0.135.2; before, it always wrote /tmp/SPAWN_COMPLETE, so a custom path never fired --on-complete). For work you start some other way, signal it at the end of your script:

sh
touch /tmp/SPAWN_COMPLETE

Spored sees the file, sends the completion notification, waits 30 seconds, then terminates the instance.

spored checks for the file once a minute, so the instance terminates about 35–95 s after the file appears with the defaults (no pre-stop hook). The full breakdown is in How long after the command exits does the instance terminate?.

The region_vacated check never delays the termination (spored v0.153.0 and later, spawn#1456). Without a notifier it doesn't run. With one, it counts the region's other spawn-managed instances when the termination is decided and again just before it, so an instance relaunched in between suppresses the event; one launched after the termination does not.