Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libcontainer: Prevent startup hang when CloseExecFrom errors #4599

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

evanphx
Copy link
Contributor

@evanphx evanphx commented Jan 21, 2025

The previous logic caused runc to hang if CloseExecFrom returned an error, as the defer waiting on logsDone never finished as the parent process was never started (and it controls the closing of logsDone via it's logsPipe).

This moves the defer to after we have started the parent, with means all the logic related to managing the logsPipe should also be running.

The previous logic caused runc to hang if CloseExecFrom returned an
error, as the defer waiting on logsDone never finished as the parent
process was never started (and it controls the closing of logsDone via
it's logsPipe).

This moves the defer to after we have started the parent, with means all
the logic related to managing the logsPipe should also be running.

Signed-off-by: Evan Phoenix <evan@phx.io>
@evanphx evanphx force-pushed the evanphx/b-logs-hang branch from 3cc01be to 7b26da9 Compare January 21, 2025 18:01
Copy link
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

This indeed makes sense. LGTM, thanks!

@AkihiroSuda AkihiroSuda merged commit 8702864 into opencontainers:main Jan 22, 2025
40 checks passed
@AkihiroSuda AkihiroSuda added the backport/1.2-todo A PR in main branch which needs to be backported to release-1.2 label Jan 22, 2025
@evanphx evanphx deleted the evanphx/b-logs-hang branch January 22, 2025 01:40
@kolyshkin
Copy link
Contributor

@kolyshkin kolyshkin added backport/1.2-done A PR in main branch which has been backported to release-1.2 and removed backport/1.2-todo A PR in main branch which needs to be backported to release-1.2 labels Feb 26, 2025
@cyphar cyphar mentioned this pull request Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.2-done A PR in main branch which has been backported to release-1.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants