bug: Kubernetes bootstrap retry limits can leave sandboxes terminal during gateway startup
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- kubernetes, rust
调研方向
从 crates/openshell-sandbox/src/lib.rs 开始,重点检查用于获取策略的 grpc_retry 逻辑和 SIDECAR_READY_TIMEOUT_SECS,然后检查 crates/openshell-driver-kubernetes/src/driver.rs 以及 crates/openshell-server/src/compute/mod.rs。构建所提议的隔离 Kubernetes 复现环境,延迟 gateway 的可用时间,并验证生命周期转换、workspace 保留、有界且可取消的重试,以及一条有文档记录的恢复路径,同时不重放已完成的 workload。
由索引模型根据 Issue 内容生成。
描述
User Story
As a Kubernetes operator, I want sandbox bootstrap to tolerate temporary gateway unavailability, so that dependency startup ordering does not require destructive recovery.
Problem Statement
This is a source-based report against public OpenShell v0.0.116 code. The deterministic reproduction below is proposed, not a claim of a completed isolated upstream test. No private deployment logs or configuration are included.
Three public implementation details appear to make delayed gateway startup a terminal sandbox failure:
grpc_retryin the sandbox runtime makes five attempts, with 1/2/4/4-second waits. When initial policy fetching cannot connect, it returns an error after exhausting those attempts.- The same file defines a separate
SIDECAR_READY_TIMEOUT_SECS = 120for the process supervisor waiting on the network supervisor. Extending the policy retry window alone would not remove this second deadline. - The Kubernetes driver deliberately renders
restartPolicy: Never, with a comment explaining that kubelet must not replace the canonical main-process generation after supervisor exit.
Consequently, a transient dependency outage before workload activation can exhaust bootstrap retries, terminate the pod, and leave no automatic retry when the gateway becomes available. The same retry limits remain in inspected main commit 02b664bb0d978ac0baec9aaa0bf06a2a4f67e83d.
Impact / Why This Matters
Kubernetes does not guarantee that the gateway is ready before sandbox pods start during cluster recovery. A short-lived startup outage should not require deleting a persistent sandbox.
The v0.0.116 gateway start handler rejects terminal Error phases; it allows Ready as an idempotent return and Stopped/Starting for start. This makes a documented, data-preserving recovery path important in addition to bootstrap retry behavior. Blanket automatic deletion/recreation would be inappropriate for persistent workspaces.
Acceptance Criteria
- Before workload activation, a sandbox can tolerate transient gateway unavailability and become usable once the gateway returns without manual deletion.
- A regression test delays gateway availability beyond both the current policy-fetch retry window and the 120-second process-sidecar wait.
- No workload starts before authenticated policy and required enforcement bootstrap succeed. Permanent authentication/configuration/policy errors remain explicit failures, and TLS validation is preserved.
- Individual attempts are bounded, retries use capped backoff, and waiting is cancellable and diagnosable.
- Existing workspace data survives the tested recovery.
- Explicit stops and completed workloads remain terminal; fixing bootstrap does not silently replay completed commands.
- Document a supported, data-preserving recovery path for sandboxes already in terminal bootstrap error.
Reproduction Steps
Proposed deterministic test, not yet executed as an isolated upstream reproduction:
- Use a disposable Kubernetes deployment with the v0.0.116 gateway, supervisor, and sidecar topology.
- Create a persistent sandbox and write a workspace sentinel.
- Simulate dependency recovery so a replacement sandbox pod starts while its gateway callback is unavailable. Keep the gateway unavailable for more than 120 seconds.
- Restore gateway availability.
- Check pod/Sandbox/gateway state, whether a shell becomes usable without resource deletion, and whether the workspace sentinel is retained.
The public code predicts an exhausted Policy fetch retry followed by the separate sidecar-control-socket timeout. A regression test should establish the exact lifecycle transitions as well as successful recovery after the fix. Fault injection should use an isolated test deployment, not a shared production gateway.
Environment
Source versions and configuration relevant to the proposed test, not private deployment inventory:
- OpenShell: public tag v0.0.116, latest published release at filing.
- Additional source inspection: main commit 02b664bb0d978ac0baec9aaa0bf06a2a4f67e83d; no runtime test of that commit is claimed.
- Compute driver: Kubernetes.
- Supervisor topology: sidecar.
- Persistent workspace; driver-generated
restartPolicy: Never.
Related Work
#2179 and #2269 concern Docker/Podman Error-phase recovery. #2417 explicitly keeps Kubernetes lifecycle cluster-owned. They provide useful lifecycle context but do not appear to resolve the Kubernetes bootstrap retry limits above.
Changing pod restartPolicy globally to Always would alter the deliberately terminal main-process contract. This report requests bootstrap-specific resilience and a supported recovery path, not automatic replay or deletion of arbitrary failed workloads.
- 主要语言
- Rust
- 星标
- 8.7k
- 派生
- 1.3k
- 平均合并
- 2 天 6 小时
- 30 天内合并 PR
- 297
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NVIDIA/OpenShell 的其他 Issue
-
area:docs
难度 1/5 1 小时以内 新手友好度 88/100
-
state:triage-needed
难度 2/5 1-3 小时 新手友好度 82/100
-
area:cli state:validated
难度 2/5 1-3 小时 新手友好度 72/100
-
state:triage-needed
难度 1/5 1 小时以内 新手友好度 90/100
-
area:build spike state:review-ready state:stale
难度 2/5 半天 新手友好度 68/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
-
state:needs triage
难度 2/5 1-3 小时 新手友好度 70/100
zed-industries/zed#64680 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 70/100
RustPython/RustPython#8802 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
TheLarkInn/aipm#2390 ·