Skip to content

spored ties instance lifecycle to the spawn:command process — killing/restarting the workload stops the instance; make coupling optional (sentinel-only completion) #224

Open

Description

@scttfrdmn

Summary

Killing the workload's launcher process (the bash /tmp/run.sh started via spawn:command)
caused spored to treat the job as complete/idle and stop the whole instance. Manually
managing the workload (kill an old run to restart a fixed one) shouldn't tear down the box.
spored's completion/idle tracking appears tightly coupled to a specific process tree, with no way
to detach or restart the workload in place.

What happened (spawn v0.62.0, lagotto-launched instance)

  1. spawn:command launched bash /tmp/run.sh (which fork/execs the inference workers).
  2. To swap in a fixed inference script, I pkill-ed the workers AND the run.sh wrapper.
  3. Within ~moments the instance went to stopping — "User initiated". spored interpreted the
    disappearance of the tracked process as completion/idle and triggered on_complete/idle stop.

So there was no way to "stop the job, swap the script, restart the job" on the same instance —
killing the job killed the instance. For a long, expensive GPU box you want to iterate on the
workload without losing the instance (and, here, without losing the capacity slot you waited
12.5h for).

Request

Make the workload↔instance-lifecycle coupling optional / looser:

  1. A way to restart the workload in place without spored treating the gap as completion — e.g.
    a grace/“maintenance” mode, or spored keying completion on the explicit SPAWN_COMPLETE
    sentinel ONLY (not on the tracked process exiting). If completion is sentinel-driven, killing
    and relaunching the run script is invisible to spored until the sentinel actually appears.
  2. Decouple --command's process from the idle/complete trigger by default, or via a flag
    (e.g. --on-complete=signal-only): the instance stops when /tmp/SPAWN_COMPLETE is written or
    idle-timeout elapses, NOT merely because the launched command's PID went away.
  3. At minimum, document that killing the spawn:command process triggers stop, so operators don't
    accidentally tear down a box while iterating.

Why it matters

Beta-testing the SAM pipeline (BuckAI/fieldwork): I needed to swap a serial inference script for a
pipelined one on a running, hard-won g5.12xlarge. Killing the old job to restart it stopped the
instance instead — turning an in-place script swap into a full relaunch (and another capacity
wait). The sentinel-file model (#66/#65 era) already exists; completion should be driven by the
sentinel, not by the liveness of one process.

Version

spawn v0.62.0

Activity

  1. added
    enhancement
    on Jun 18, 2026
  2. added this to the Later milestone on Oct 19, 2026
  3. modified the milestones: Later, Hardening on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions