-
Notifications
You must be signed in to change notification settings - Fork 262
unshare: fix data race #2254
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
unshare: fix data race #2254
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giuseppe The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
lgtm (for what it is worth.) |
LGTM once the lint issue is fixed. |
on errors, kill immediately the child process and release the used resources. Closes: containers#2221 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
1ea98c9
to
3e5684d
Compare
CI is green now |
/lgtm |
@@ -167,6 +167,15 @@ func (c *Cmd) Start() error { | |||
return err | |||
} | |||
|
|||
// If the function fails from here, we need to make sure the | |||
// child process is killed and properly cleaned up. |
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.
Is this code not using PR_SET_PDEATHSIG
? It's always a good idea IMO.
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.
I had to drop PR_SET_PDEATHSIG
in the past: 10caa2a
PR_SET_PDEATHSIG
would work only if we lock the current thread, and it is difficult to say how the caller is going to use it, or if it is invoked from a goroutine
on errors, kill immediately the child process and release the used resources.
Closes: #2221