Skip to content

executor: avoid runc stdin shutdown hangs - #6815

Merged
crazy-max merged 1 commit into
moby:masterfrom
tonistiigi:stdin-fix
Jun 9, 2026
Merged

crazy-max merged 1 commit into
moby:masterfrom
tonistiigi:stdin-fix

Conversation

@tonistiigi

Copy link
Copy Markdown
Member

Forward non-tty stdin through an os.Pipe so runc receives an *os.File instead of the caller's reader. This lets runc exit after the container process is killed without waiting on Go's internal stdin copy.

Add gateway coverage for graceful pid1 exit, release-based cleanup, and explicit SIGKILL while pid1 stdin is still open.

@thaJeztah

Copy link
Copy Markdown
Member

@tonistiigi is this something we could also encounter elsewhere (e.g. in containerd's code)?

@tonistiigi

Copy link
Copy Markdown
Member Author

@thaJeztah Possibly yes. This is not obvious when using the containerd client.

@tonistiigi tonistiigi added this to the v0.31.0 milestone Jun 1, 2026
@tonistiigi

Copy link
Copy Markdown
Member Author

@thaJeztah containerd fix is actually in cc9567d#diff-c83ca16dc6375f54885f0e9a4b022bcb2354b35a98e997fde62fa754fa80034d . I mixed up the PRs

Comment thread executor/runcexecutor/executor_linux.go Resolved
Forward non-tty stdin through an os.Pipe so runc receives an *os.File
instead of the caller's reader. This lets runc exit after the container
process is killed without waiting on Go's internal stdin copy.

Add gateway coverage for graceful pid1 exit, release-based cleanup, and
explicit SIGKILL while pid1 stdin is still open.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@crazy-max
crazy-max merged commit 63e37e8 into moby:master Jun 9, 2026
192 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants