-
Notifications
You must be signed in to change notification settings - Fork 42
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
Incorrect use of Pdeathsig for killing child on linux. #173
Comments
We had a lot of redudant code that was deleted with the extension subcommand. However, code analysis failed to notice other parts that are only referenced in their own tests. This completes removal of the extra code made for the extension experiment. Fixes #172 #173 Signed-off-by: Adrian Cole <adrian@tetrate.io>
We haven't done the suggested solution specifically, since the experiment in https://gist.github.com/dio/85d51d0c199b7598cefa56cb95521537 shows that it only matters for many children processes. However, we have added tests for making sure when killing |
works for me. thanks for the research and if something changes in the future (like somehow we start a million envoys), we can reference this! |
Describe the bug
Right now, on Linux, we set
SysProcAttr.Pdeathsig = SIGTERM
with a comment that this will kill the child when the parent dies. This is incorrect usage to achieve the results. The correct way to use Pdeathsig would be to launch a goroutine, lock it to the OS thread, start the child in that goroutine, and don't exit the goroutine until the child exits.While revisiting this, we should re-check any assumptions for example that SIGTERM is the appropriate signal to catch.
Personally, I think we should prefer behaviour mentioned in the relevant go issue on conflict as many signal related code have had problems here.
Additional context
See golang/go#27505 (comment) for an example
See rootless-containers/rootlesskit#65 for a discussion leading to this
The text was updated successfully, but these errors were encountered: