fix(remote): serialise starts of one environment with a lock - #263
Draft
outofcoffee wants to merge 3 commits into
Draft
outofcoffee wants to merge 3 commits into
outofcoffee wants to merge 3 commits into
Conversation
added 3 commits
October 5, 2026 23:41
A start took no lock, so two starts close together could each miss the other's not-yet-visible instance and launch one apiece. Starts now take a per-environment SSM lock that expires with the invocation, a refused start replies with a retryable 503, and a start whose instance is stopped under it ends at once and releases the lock. Status reports a start in progress. Closes #224
This branch has not been deployed
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.
Two starts for one remote environment can no longer both launch an instance, whichever client they come from.
Closes #224
Summary
starting("another start is in progress"), which the CLI and gateway already retry./cloud-vm-llm/<env>/wake-lock. It expires when the invocation that took it would time out, so a start killed before it could release the lock blocks its environment for at most about 15 minutes. An expired or unreadable lock is taken over.statusshows a start in progress: the state isstartingwhile the lock is held and the instance is absent, stopped or pending, and every reply carriesstart_in_progress.spinloop statusprints it with no client change.ssm:DeleteParameteron the lock parameter only.wake-lock(a delta toendpoint-lifecycle), with docs and tests.Implementation details
startwill wake the instance again. That matches what happened before once the deadline passed, only sooner.statusdoes not show it as starting.pnpm run deployorspinloop remote bootstrap) for the new grant.The OpenSpec change is not archived yet.