Repository navigation
fix(kubernetes): prevent stop-start relay race - #3064
Merged
Merged
Conversation
Signed-off-by: John Myers <[email protected]>
johntmyers
requested review from
a team,
derekwaynecarr,
mrunalp and
sjenning
as code owners
August 31, 2026 22:34
|
Label |
|
Label |
6 of 7 tasks
krishicks
approved these changes
Aug 31, 2026
drew
approved these changes
Aug 31, 2026
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
Fix a Kubernetes v1beta1 stop/start race that allowed a sandbox to report
Stoppedand restart while its previous pod was still terminating. The old supervisor could then close the newly claimed exec relay before reporting an exit status.The regression was exposed by #2884: intentional lifecycle shutdown discards the canonical process exit result, but the new terminal-finalization loop treated that discarded result as unfinalized and retried until Kubernetes exhausted its 30-second termination grace period.
Affected CI evidence
Each linked job failed in
sandbox_stop_start_preserves_workspacewithexec relay closed before the command reported an exit status:Related Issue
No issue required: this is a localized regression fix with an existing deterministic lifecycle E2E test and CI evidence across unrelated PRs.
Changes
Deleting,Stopping, andStoppedlifecycle transitions so the supervisor can terminate promptly.Suspended=Trueand deletion of the old pod before a Kubernetes v1beta1 stop completes.Testing
mise run pre-commitpassescargo test -p openshell-driver-kubernetes --lib(228 passed)OPENSHELL_E2E_KUBE_TEST=sandbox_lifecycle mise run e2e:kubernetes(7 passed, includingsandbox_stop_start_preserves_workspace)Checklist