Repository navigation
shim: support to check fifo is deleted - #14431
Open
ningmingxiao wants to merge 1 commit into
Open
ningmingxiao wants to merge 1 commit into
ningmingxiao wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟡 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>
ningmingxiao
force-pushed
the
check_fifo
branch
from
October 20, 2026 04:36
429eaf3 to
af05f53
Compare
This was referenced Oct 20, 2026
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.

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