Repository navigation
fix(connect,resume): one wake path for stopped/hibernated/stopping; resume never guesses a region (#57, #495) - #1234
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This was referenced Oct 20, 2026
…esume never guesses a region (#57, #495) connect: the shell/one-shot and DCV app paths share wakeForConnect; a stopping instance is waited out then started; hibernated is reported as resuming; the app path now honours --no-start. resume: per-instance region recorded in sweep state at launch; resume reconciles each instance in its recorded/param/configured region and errors asking for --region instead of panicking on a param file with no region default or falling back to us-east-1.
scttfrdmn
force-pushed
the
fix/connect-resume-57-495
branch
from
October 20, 2026 17:19
011fe41 to
b25d996
Compare
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.
Fixes #57
Fixes #495
#57 — connect wakes stopped, hibernated and stopping instances on every path
cmd/connect.gohad two auto-starts. The shell/one-shot path startedstoppedand
stopping(EC2 rejects StartInstances on a stopping instance, so that branchcould only fail). The DCV app path started only
stopped, ignored--no-start,and let a
stoppinginstance fall through to a five-minute wait for a ready URL.Both now call one helper,
wakeForConnect(cmd/connect_wake.go):aws.Client.WaitForStopped), then start.--no-start: refuse, with no EC2 calls.Client.UserInitiatedHibernate),falling back to spawn's
spawn:last-stop-reason=user-hibernatedtag. The messagethen reads "Instance is hibernated — resuming it...".
#495 — resume: no panic, no us-east-1 guess
region, taken from LaunchResult at allthree record sites.
resolveResumeRegionspicks each instance's region in this order: recorded, thenthe param set's own region, then the file default (checked assertion), then the
shared config region (flag > SPORE_REGION/AWS_REGION > spore config, the same
source launch reads). If none of those is set, resume returns an error that names
the instance and
--region. This runs before any AWS client is built.--region, then the sweep's single recorded region,then the shared config. If none is set, resume refuses. The hard-coded us-east-1
is gone.
regions is reconciled in each region.
Gates, each watched failing against a revert that compiles
TestEveryConnectPathWakesThroughTheSharedHelperis an AST check over thediscovered
connect*.gofiles: StartInstance may only be called fromwakeForConnect, and runConnect and connectDCV must both call it. I reverted
connectDCV to the old stopped-only StartInstance block and the test failed on
both counts.
TestWakeForConnect_StoppingIsWaitedOutThenStarted: dropping the stopping wait(
if false) makes it fail with the observed call order.TestWakeForConnect_StartsStoppedAndHibernated: disabling hibernation detectionmakes it fail on the message.
TestRunResume_ParamFileWithoutRegionDefaultDoesNotPanicdrives runResume withthe issue's input. With the original unchecked assertion restored, it panicked
with
interface {} is nil, not string.TestResolveResumeRegions_PendingFallbackNeverDefaultsToUSEast1: restoring theus-east-1 fallback makes it fail.
TestEverySweepInstanceRecordSetsItsRegionis an AST check over everyInstanceState literal in non-test cmd files, and fails if it finds none. Dropping
Region:from one literal makes it fail at launch_sweep.go:541.Checks
make check passes every step except
check-build-tags, which fails identically onunmodified main on this machine (the /private/tmp path issue). make lint: 0 issues.
semgrep: clean. api-snapshot regenerated (one addition, WaitForStopped). gen-docs /
check-docs: no drift.