Repository navigation
fix(extend): reload spored over SSM on keyless instances; non-zero exit when reload fails (#1113) - #1190
Merged
Conversation
…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
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
spawn extendreloaded spored only over SSH. On a keylessspawn task runinstance (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.triggerReloadnow goes through areloadTransportseam. It tries SSH when we hold the launch key and the instance has a public IP. Otherwise, or when SSH fails, it runs the samesudo /usr/local/bin/spored reloadover SSMAWS-RunShellScript(client.RunShellScript, 60s bound). Both paths share onereloadSporedCommandconstant. A non-Successstatus or a non-zero exit from SSM counts as a failure.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).Gates (each watched failing against a revert that compiles)
TestTriggerReload_KeylessInstanceReloadsOverSSM: with no key, the recording SSM fake gets exactlyus-west-2|i-0abc|sudo /usr/local/bin/spored reloadand SSH is not called. Revert (return the SSH error before the SSM fallback): FAIL.TestTriggerReload_SSHFailureFallsBackToSSMalso 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 nilafter the warning): FAIL.TestJobArrayExtendResult_ReloadFailureIsNonZero. Revert (only tag failures count): FAIL.Checks
make check: everything passes exceptcheck-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