-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix race in runc exec #1812
Fix race in runc exec #1812
Conversation
@crosbymichael @cyphar @dqminh PTAL |
This is triggered by healthchecks in Dockerfile and kubernetes readiness/liveness probes. Credit to Ulrich Obergfell for pinpointing this issue. |
c692f2c
to
ee36781
Compare
There is a race in runc exec when the init process stops just before the check for the container status. It is then wrongly assumed that we are trying to start an init process instead of an exec process. This commit add an Init field to libcontainer Process to distinguish between init and exec processes to prevent this race. Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -140,6 +140,7 @@ func execProcess(context *cli.Context) (int, error) { | |||
detach: detach, | |||
pidFile: context.String("pid-file"), | |||
action: CT_ACT_RUN, | |||
init: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should not need this.
There is a race in runc exec when the init process stops just before
the check for the container status. It is then wrongly assumed that
we are trying to start an init process instead of an exec process.
Signed-off-by: Mrunal Patel mrunalp@gmail.com