Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

bug: distinguish intentional signal stops from runtime restarts

未关闭
#3,083 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
docker, rust

调研方向

跟踪 Docker 和 Podman 驱动对退出代码 137/143 的处理,然后继续跟进 gateway 停止意图和延迟的 watcher 快照如何更新 sandbox 状态。检查与 issues #2855 和 #2179 相关的现有恢复行为,并为两个驱动运行或扩展回归测试覆盖。完成的标准是:有意停止仍保持为终态且可区分,而真正的运行时重启仍可恢复,同时 OOM 和普通退出保持不变。

由索引模型根据 Issue 内容生成。

描述

area:compute area:sandbox state:stale

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 Stopped when 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

  1. Start a Docker- or Podman-backed sandbox.
  2. Stop it through the gateway so the supervisor forwards SIGTERM to its workload.
  3. Observe the driver report exit 143 as ContainerRuntimeRestart.
  4. Deliver that watcher snapshot after the gateway has persisted Stopped.
  5. Observe the sandbox phase remain Stopped while 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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NVIDIA/OpenShell 的其他 Issue

查看 NVIDIA/OpenShell 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。