bug: distinguish intentional signal stops from runtime restarts
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- docker, rust
调研方向
跟踪 Docker 和 Podman 驱动对退出代码 137/143 的处理,然后继续跟进 gateway 停止意图和延迟的 watcher 快照如何更新 sandbox 状态。检查与 issues #2855 和 #2179 相关的现有恢复行为,并为两个驱动运行或扩展回归测试覆盖。完成的标准是:有意停止仍保持为终态且可区分,而真正的运行时重启仍可恢复,同时 OOM 和普通退出保持不变。
由索引模型根据 Issue 内容生成。
描述
User Story
As an OpenShell operator, I want sandbox status to distinguish an intentional shutdown from a runtime interruption, so that stopped sandboxes are not presented as having restarted unexpectedly and real runtime restarts remain recoverable.
Problem Statement
The Docker and Podman drivers currently classify exits 137 (SIGKILL) and 143 (SIGTERM) as ContainerRuntimeRestart. Those codes establish only that a process was terminated by a signal; they do not identify the sender or intent. An explicit gateway stop that forwards SIGTERM therefore produces the same condition as a Podman/Docker machine or daemon restart.
The durable Stopping phase now prevents that ambiguity from promoting an in-flight explicit stop to Error, but a delayed watcher snapshot can still arrive after Stopped is persisted and replace the user-visible status reason with ContainerRuntimeRestart.
Impact / Why This Matters
Operators can see a sandbox in Stopped phase with a contradictory runtime-restart condition after a normal stop. More broadly, treating all 137/143 exits as runtime restarts conflates graceful stop, forced timeout kill, external intervention, and genuine runtime interruption. The current workaround is to infer intent from lifecycle phase, which protects the immediate flow but does not make the driver status semantically precise.
Acceptance Criteria
- An explicit gateway stop remains
Stoppedwhen a late Docker or Podman signal-exit snapshot arrives, and its terminal status continues to report the intentional stop. - A signal termination without explicit stop intent remains distinguishable from a confirmed runtime interruption.
- Gateway restart recovery continues to recover sandboxes interrupted by a real Docker or Podman runtime/machine restart.
- OOM termination and ordinary application exits keep their existing distinct behavior.
- Regression coverage covers Docker and Podman for explicit SIGTERM stop, forced SIGKILL timeout, delayed watcher delivery, OOM, and runtime/machine restart.
Reproduction Steps
- Start a Docker- or Podman-backed sandbox.
- Stop it through the gateway so the supervisor forwards SIGTERM to its workload.
- Observe the driver report exit 143 as
ContainerRuntimeRestart. - Deliver that watcher snapshot after the gateway has persisted
Stopped. - Observe the sandbox phase remain
Stoppedwhile its condition reason no longer reflects the intentional stop.
Environment
- OpenShell: current main development build
- Compute drivers: Docker and rootless Podman
- Related issue: #2855
- Historical recovery behavior: #2179
Agent Investigation
ContainerRuntimeRestart is currently a heuristic for exit 137/143 in both Docker and Podman. The exit status has no provenance, so operation intent and independently observed runtime state must be considered separately.
- 主要语言
- 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 ·