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
docker exec
should cleanup its orphaned processes when it exits
#9994
Conversation
nice - can you please add a sentence or two to this effect into the I'm interested to see how (or if) users will want to start new daemon processes using |
I think this should have a flag to control the behavior. While I somewhat agree with the idea in this change, I do not think it that unreasonable for some more complex applications & systems to use |
@phemmer @SvenDowideit in that case, would it make more sense to run each long-running process in a different The purpose of the patch is to prevent that exact situation as ideally an exec session should not leave orphaned process inside the PID namespace when it finishes. |
@dqminh I think that libcontainer was bumped and now you can rebase against master. |
yes, I guess yes, I realised talking to some people last night, that you might have a long running upgrade / transform task you might start with no-easy-answer |
I'd document what the PR does now, as it seems like a useful addition as is. |
ah no, it currently doesnt behave like that. The behavior of how Starting a long running exec session with
@SvenDowideit i will add some docs to cli and the HTTP api to document the new behavior for this patch. |
Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh) Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com>
execin now requires us to pass in the execin's session id so it can create cgroups to track orphaned processes Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh) Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com>
5a81d80
to
79bbb4d
Compare
Actually i think it probably makes more sense to have the cgroup setup as an optional part. Some of our users do want to launch background processes from an interactive exec session and dont want them to be shut down automatically. I will close this and open again when it's ready. |
@dqminh Is there followup on this PR? |
Some background on this is at:
docker exec
command will not terminate the spawned process #9098TLDR:
docker exec
process when exits can leave behind orphaned/unwanted processes, this patch put all processes belongs to a singledocker exec
session into its own subcgroup and removes them when the main process finishes. This will not affect processes spawned in the container and/or other exec sessions.