Repository navigation
Conversation
After the main process exits, the supervisor keeps its access plane, and SSH and port forwarding already reached Completed and Error sandboxes while it stayed connected. Exec still required Ready in both the CLI and the gateway, so it was refused on the same sandboxes. Exec, SSH sessions, and TCP forwarding now share one gate: a sandbox is reachable when it is Ready, or Completed/Error with a supervisor session on this replica or a fresh owner record naming a peer replica. The previous check only looked at the local session map, so on a multi-replica gateway a request landing on a non-owner replica was refused even though relay opening routes to the owner. The CLI exec pre-check and the service forward recheck accept Ready, Completed, and Error and leave the supervisor decision to the gateway. Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
…upervisor Exposed-service HTTP routing still required Ready while port forwarding to the same sandbox kept working after the main process exited. Service routing now uses the shared relay reachability gate, so a retained Completed or Error sandbox serves its exposed services while its supervisor stays connected. Document what stays reachable after a retained sandbox's main process exits, and that --no-keep sandboxes are deleted once it does. Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Add a sandbox-retention scenario that runs for exit codes 0 and 3: an ephemeral (--no-keep) sandbox returns the exit code and is deleted, and a retained sandbox records Completed or Error with the exit code and still accepts exec. Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
|
🌿 Preview your docs: https://nvidia-preview-pr-4950.docs.buildwithfern.com/openshell |
Add a phase diagram to the Sandbox Lifecycle section and describe what happens after the main process exits. A --no-keep sandbox is deleted. A retained sandbox keeps its compute and still accepts exec, file transfer, port forwarding and exposed services while its supervisor is connected. sandbox connect fails because it attaches to the exited main process, so the docs point to sandbox exec --tty for a shell. Signed-off-by: Piotr Mlocek <pmlocek@nvidia.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
When a retained sandbox's main process exits, the supervisor stays connected so you can still get into the sandbox. SSH, file transfer and port forwarding already worked in that state. Exec and exposed services did not, so
openshell sandbox exec -- cat result.txtfailed on a sandbox you coulddownloadthe same file from. On a gateway with several replicas, the post-exit check also only looked at the replica that received the request, so access worked or failed depending on the load balancer.This PR applies one rule to every way into a sandbox. A
Readysandbox is reachable. ACompletedorErrorsandbox is reachable while its supervisor is connected to any replica. Every other phase is refused. The gateway makes the call, and the CLI no longer rejectsCompletedorErroron its own. #4949 has the full set of rules and a lifecycle diagram. New ways into a sandbox should use the same check.Related Issue
Closes #4949
Changes
CompletedandErrorsandboxes to the gateway.--no-keepsandboxes are deleted.sandbox-retentionconformance scenario checks both cases, for exit codes 0 and 3. A--no-keepsandbox is deleted. A retained sandbox records the exit code and still accepts exec.Testing
mise run pre-commitpassesThe conformance scenarios ran against a local Docker gateway built from this branch. I didn't test Kubernetes, Podman or a real multi-replica gateway live.
Still broken and tracked in #4949: after a Docker gateway restart,
CompletedandErrorsandboxes lose their supervisor and can't be reached.Checklist