Skip to content

fix(extend): reload spored over SSM on keyless instances; non-zero exit when reload fails (#1113) - #1190

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/1113-extend-ssm
Oct 19, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/1113-extend-ssm

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Summary

spawn extend reloaded spored only over SSH. On a keyless spawn task run instance (SSM-only) the new TTL or cost limit was written to the tags but spored kept enforcing the old one. extend printed a warning and exited 0.

  • triggerReload now goes through a reloadTransport seam. It tries SSH when we hold the launch key and the instance has a public IP. Otherwise, or when SSH fails, it runs the same sudo /usr/local/bin/spored reload over SSM AWS-RunShellScript (client.RunShellScript, 60s bound). Both paths share one reloadSporedCommand constant. A non-Success status or a non-zero exit from SSM counts as a failure.
  • If neither path works, single-instance extend returns an error (non-zero exit). The error names both failures and prints spawn connect <id> -- 'sudo spored reload' as the manual fallback. The job-array form also exits non-zero when any member was not updated or not reloaded (jobArrayExtendResult).
  • CHANGELOG: the non-zero exit is under Changed and the SSM fallback under Fixed.

Gates (each watched failing against a revert that compiles)

  • TestTriggerReload_KeylessInstanceReloadsOverSSM: with no key, the recording SSM fake gets exactly us-west-2|i-0abc|sudo /usr/local/bin/spored reload and SSH is not called. Revert (return the SSH error before the SSM fallback): FAIL. TestTriggerReload_SSHFailureFallsBackToSSM also fails against that revert.
  • TestReloadAfterExtend_BothPathsFailingIsANonZeroExit: with SSH and SSM both failing, the result is a non-nil error that names both, and stdout has no "reloaded" claim. Revert (return nil after the warning): FAIL.
  • TestJobArrayExtendResult_ReloadFailureIsNonZero. Revert (only tag failures count): FAIL.

Checks

  • make check: everything passes except check-build-tags. That step fails the same way on unmodified main on this machine (/private/tmp paths), confirmed in a clean worktree.
  • semgrep scan --config=auto --error .: clean. make check-docs: clean (no help text changed).

Not verified: a live SSM reload against a real instance (no AWS calls were made). Windows instances are not handled here. The SSH path already hardcoded /usr/local/bin/spored, so this matches existing behaviour.

Fixes #1113

…ro when reload fails (#1113)

triggerReload was SSH-only, so on a keyless spawn task run instance the new
TTL/cost limit was tagged but never applied, and extend exited 0 with a
warning. It now falls back to the same `spored reload` via SSM
AWS-RunShellScript when there is no key/public IP or SSH fails, and a reload
that reaches no path is a non-zero exit (single and job-array forms).

Fixes #1113
@scttfrdmn scttfrdmn added this to the v0.136.0 milestone Oct 19, 2026
@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.71429% with 22 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/extend.go 60.71% 22 Missing ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 16fa5f8 into main Oct 19, 2026
8 checks passed
@scttfrdmn
scttfrdmn deleted the fix/1113-extend-ssm branch October 19, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spawn extend: reload is SSH-only, so on a keyless task instance a new TTL/cost limit is tagged but never applied

1 participant