Skip to content

--on-complete stop doesn't trigger when SPAWN_COMPLETE written by job started via spawn connect -- #105

Closed

Description

@scttfrdmn

Summary

When a job is launched via spawn connect <name> -- 'nohup bash /tmp/run.sh > /tmp/run.log 2>&1 &', spored does not honour --on-complete stop even after /tmp/SPAWN_COMPLETE is written by the run script.

Reproduction

# Launch with --on-complete stop
spawn launch fem-hpc \
    --instance-type hpc6a.48xlarge \
    --count 2 \
    --on-complete stop \
    --ttl 4h

# Start job via one-shot connect
spawn connect fem-hpc-0 -- \
    'nohup bash /tmp/run.sh > /tmp/run.log 2>&1 &'

# run.sh ends with: touch /tmp/SPAWN_COMPLETE

After run.sh completes and writes /tmp/SPAWN_COMPLETE, the instances remain running indefinitely. spawn status shows them as running with no pending stop action. Manual stop required.

Expected behaviour

spored polls /tmp/SPAWN_COMPLETE (configurable via --completion-file) and triggers the --on-complete action when the file appears, regardless of how the job was started. This works when the job is started via --command at launch time — but apparently not when started later via spawn connect --.

Workaround

Stop instances manually after the job completes:

aws ec2 stop-instances --instance-ids <id1> <id2> --region <region>

Version

spawn v0.34.13


Migrated from spore-host/spore-host#354 — refiled here as spawn issues belong on this repo.

Activity

  1. added
    bug
    area:spored
    area:lifecycle
    on Jun 12, 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

    area:lifecyclearea:sporedbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions