Skip to content

--command with a custom --completion-file never triggers --on-complete #1131

Closed

Description

@scttfrdmn

Found in code during spore-host/spore-host#585 part 2. Not yet reproduced on an instance.

  • spored watches whatever --completion-file names. The flag defaults to /tmp/SPAWN_COMPLETE (cmd/launch_flags.go:322), is set into config.CompletionFile (cmd/launch_config.go:297), and spored watches it (cmd/spored/main.go:770).
  • The --command wrapper ignores it. In pkg/launcher/bootstrap.go, both the failed-prerequisite path (:855) and the normal exit path (:890) write the hardcoded /tmp/SPAWN_COMPLETE.

Consequence: spawn launch --command … --completion-file /data/done --on-complete terminate never sees completion. The instance bills until its TTL. This is the same cost failure #614 fixed for the default path.

Fix: render the configured path into the wrapper, quoted. Add a test with a non-default --completion-file that asserts the wrapper writes to that exact path, and no longer to the default.


Also found: queue files must set queue_id.

  • cmd/launch_batchqueue.go:68-71 generates an ID "if not set".
  • But queue.LoadConfig already ran ValidateQueue, which rejects an empty queue_id (pkg/queue/queue.go:66).
  • So the auto-ID branch is dead for --batch-queue files, and a file without queue_id fails.

Either generate the ID before validating, or drop the branch. The docs now say queue_id is required.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions