Repository navigation
fix(launch): wait for SSM agent before probing spored (#277 Symptom A) - #279
Merged
Merged
Conversation
The spored-readiness gate (verifySporedReady) sent 'spored status' over SSM
immediately after launch. On a fresh AL2023/Graviton spot instance the SSM agent
hasn't registered yet, so every SendCommand failed until the 3m gate timed out
('context deadline exceeded') — even though SSH was up in ~120s, making
'spawn launch --command' unusable on those instances.
Fix: verifySporedReady now first calls WaitForSSMOnline (polls
DescribeInstanceInformation for PingStatus=Online, and fails FAST with
ErrSSMUnreachable if the instance has no IAM instance profile — the agent could
then never register), and only then polls 'spored status'. The 30s SendCommand
timeouts no longer accumulate against a not-yet-registered agent. Gate budget
raised 3m -> 5m for Graviton registration latency.
Substrate-backed tests: an instance with a profile reaches Online and the gate
passes; a no-profile instance fails fast (ErrSSMUnreachable, <10s) instead of
burning the full timeout.
Addresses #277 (Symptom A). Symptom B (--require-spored=false early terminate)
is separate and needs a live repro.
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.
Addresses #277 Symptom A:
spawn launch --commandon a fresh m8g.4xlarge / AL2023 (spot) consistently failed the spored-readiness gate withspored did not become ready within 3m0s: ssm send-command: ... context deadline exceeded— even though SSH was up within ~120s.Root cause
verifySporedReadysentspored statusover SSMSendCommandimmediately, without first waiting for the SSM agent to register. On a just-booted AL2023/Graviton spot instance the agent lags, so everySendCommandfails until the whole 3m gate deadline elapses — surfacing as an opaque "context deadline exceeded".Fix
verifySporedReadynow:Onlinefirst, via the existingWaitForSSMOnline(pollsDescribeInstanceInformation). Crucially, that helper fails fast withErrSSMUnreachableif the instance has no IAM instance profile (the agent could then never register) — so a genuinely-doomed launch errors in seconds instead of waiting out the timeout.spored statusas before (the agent is Online now, soSendCommandreaches it).Gate budget raised 3m → 5m to accommodate Graviton agent-registration latency; the online-wait gets the bulk, with 30s reserved for the status poll.
Tests (substrate-backed)
TestVerifySporedReady_WaitsForSSMOnlineThenSucceeds— instance with a profile reaches Online, gate passes.TestVerifySporedReady_NoProfileFailsFast— no-profile instance fails fast (ErrSSMUnreachable, <10s), not a full-timeout burn.gofmt/vet/go test ./cmd/green.Scope: #277 Symptom A only. Symptom B (
--require-spored=falsebox terminated ~100s withClient.UserInitiatedShutdown) is separate and needs a gated live repro to isolate — not addressed here.