Repository navigation
Conversation
…akeover When a shared supervisor dies or its pool rolls, the gateway hands the sandbox's supervisor session to another member and the sandbox reads Provisioning or Starting for the ten to twenty seconds the takeover takes. `sandbox exec` failed on that first observation, so one supervisor kill turned into a burst of instant failures for every exec in flight. Exec now waits, within a bounded wall-clock budget, for the sandbox to reach Ready before it collects stdin or issues anything: only Provisioning and Starting wait, every other phase fails immediately as before, and a wait that ends without Ready names its elapsed budget and last observed phase. The budget defaults to 45 seconds, is set with --exec-wait-timeout or OPENSHELL_EXEC_WAIT_TIMEOUT (clamped to 24 hours), and is disabled with --no-exec-wait or a zero budget. The wait polls GetSandbox with the create-retry jitter and backoff so hundreds of waiting execs do not poll a recovering gateway in lockstep, and it shares one implementation with the create-retry policy in openshell-core. One safe exception retries the exec a single time when the gateway's own readiness gate rejects it before any relay opens, which proves the command never started; every other failure, including a relay timeout, stays fatal. The exec e2e harness pins --no-exec-wait so existing suites keep their timing, and two regression scenarios in the shared-supervisor HA lane run exec traffic through an abrupt supervisor kill and a supervisor Deployment rollout restart, asserting the failure count stays within a race allowance, that probes succeed within the wait budget, and that sandboxes recover on their adopted process. A sandbox the rollout leaves Stopped is reported separately as the known follow-up failure rather than silently passing. The lane is wired into branch e2e behind the test:e2e-kubernetes label. Also imports kubectl_json in the shared-supervisor HA test, which origin/main omits while using it, so the test binary builds. Closes ai-openshell#5967 Signed-off-by: Emilien Macchi <emacchi@redhat.com>
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.
Summary
sandbox execnow waits, within a bounded budget, for a sandbox to come back toReadywhile a shared supervisor takeover moves it, instead of failing on the firstProvisioningread. The wait is client-side; the server only gained a machine-readable reason on its existing readiness rejection. Adds the two regression scenarios from the issue (supervisor SIGKILL, supervisor rollout restart) and wires the shared-supervisor-ha lane into branch e2e behind thetest:e2e-kuberneteslabel.Related Issue
Closes #5967
Part of #5659 (criteria a and d). Follow-ups filed for criterion b (placement) and criterion c (the Stopped sandbox).
Changes
exec_wait): onlyProvisioningandStartingwait, jittered 1-5s polls, wall-clock budget as the only boundSANDBOX_NOT_READYreason, message fallback for older gateways), transientUnavailablereads retried within the budget--exec-wait-timeout(default 45s,OPENSHELL_EXEC_WAIT_TIMEOUT, 0 disables) and--no-exec-waitshared_supervisorkubernetes-shared-supervisor-ha-e2ejob in branch-e2e.yml, label-gated, non-requiredRelease Notes
sandbox execwaits up to 45 seconds by default for a sandbox that isProvisioningorStartingto becomeReady, such as during a shared supervisor takeover, instead of failing immediately. Tune or disable with--exec-wait-timeout,OPENSHELL_EXEC_WAIT_TIMEOUT, or--no-exec-wait.Testing
Unit and integration: the 12-phase policy table, flag and env resolution, the re-wait (structured reason and message fallback), transient read tolerance, and the interactive resend. The server gained a test pinning the structured reason.
E2E on local kind: both new scenarios pass. The lane is 11 of 12;
supervisors_spread_evenly_across_gatewaysfails pre-existing (see #5969). The pre-fix CLI fails the SIGKILL scenario with 10 probe failures against an allowance of 2, which is the discrimination proof the issue asked for. The scaling lane passes 8 of 8 and conformance 77 of 77.Checklist