Skip to content

[1.4] Fix SIGCHLD race in signal handler setup#5216

Merged
rata merged 1 commit intoopencontainers:release-1.4from
lifubang:backport-5210-1.4
Apr 2, 2026
Merged

[1.4] Fix SIGCHLD race in signal handler setup#5216
rata merged 1 commit intoopencontainers:release-1.4from
lifubang:backport-5210-1.4

Conversation

@lifubang
Copy link
Copy Markdown
Member

@lifubang lifubang commented Apr 2, 2026

Backport #5210

When signal installation was moved to a goroutine for performance, containers that exited quickly could complete before SIGCHLD was registered, causing runc to hang waiting for the signal.

This fix ensures SIGCHLD is registered immediately in the main thread before other signals are handled in the goroutine, maintaining performance while guaranteeing no missed SIGCHLD notifications for fast-exiting containers.

Reported-by: Ayato Tokubi atokubi@redhat.com

(cherry picked from commit 404181e)

When signal installation was moved to a goroutine for performance,
containers that exited quickly could complete before SIGCHLD was
registered, causing runc to hang waiting for the signal.

This fix ensures SIGCHLD is registered immediately in the main thread
before other signals are handled in the goroutine, maintaining performance
while guaranteeing no missed SIGCHLD notifications for fast-exiting
containers.

Reported-by: Ayato Tokubi <atokubi@redhat.com>
Signed-off-by: lifubang <lifubang@acmcoder.com>
(cherry picked from commit 404181e)
Signed-off-by: lifubang <lifubang@acmcoder.com>
@lifubang lifubang added the backport/1.4-pr A backport PR to release-1.4 label Apr 2, 2026
@lifubang lifubang added this to the 1.4.2 milestone Apr 2, 2026
Copy link
Copy Markdown
Member

@rata rata left a comment

Choose a reason for hiding this comment

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

LGTM

@rata rata merged commit 95f27e8 into opencontainers:release-1.4 Apr 2, 2026
64 of 65 checks passed
@kolyshkin kolyshkin mentioned this pull request Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/1.4-pr A backport PR to release-1.4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants