fix(kubernetes): prevent stop-start relay race - #3064
Conversation
Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
|
🌿 Preview your docs: https://nvidia-preview-pr-3064.docs.buildwithfern.com/openshell |
|
Label |
|
Label |
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