Skip to content

shim: support to check fifo is deleted - #14431

Open
ningmingxiao wants to merge 1 commit into
containerd:mainfrom
ningmingxiao:check_fifo
Open

ningmingxiao wants to merge 1 commit into
containerd:mainfrom
ningmingxiao:check_fifo

Conversation

@ningmingxiao

@ningmingxiao ningmingxiao commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

fix: #14426
or increase handleEventTimeout

if find fifo is deleted io.copybuffer will return and the logic drain init process
https://github.com/containerd/containerd/blob/v2.4.2/cmd/containerd-shim-runc-v2/process/init.go#L301
will not use much time.
ping @fuweid

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

FIFO deletion does not reliably unblock copying, and regression tests are missing.

2 open issues
What changed in this PR

Adds FIFO-deletion monitoring to the runc v2 shim’s stream-copying code to support cleanup when FIFO paths disappear.

Changes:

  • Polls FIFO paths and closes their endpoints after deletion.
  • Integrates watchers with stdin, stdout, and stderr copying while excluding regular output files.
File Description
cmd/​containerd-shim-runc-v2/​process/​io.go Adds FIFO watchers and connects them to stream copying.

Review effort: Balanced

Comment on lines +241 to +243
func startFifoWatcher(path string, closer io.Closer, isFifo bool) func() {
if !isFifo || path == "" {
return func() {}
if _, err := os.Stat(path); err != nil && os.IsNotExist(err) {
// The fifo was removed from the filesystem; close the
// writer/reader so io.CopyBuffer returns.
closer.Close()
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
Copilot AI balanced review requested due to automatic review settings October 20, 2026 04:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Closing only the FIFO does not interrupt copies blocked on the runtime-side endpoint.

2 open issues

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Needs Triage

2 participants