[03/12] mesos git commit: Prevented Docker library from terminating incorrect processes.
Prevented Docker library from terminating incorrect processes. Previously, the Docker library might call `os::killtree()` on a PID after the associated subprocess had already terminated, which could lead to an unknown process being incorrectly killed. Review: https://reviews.apache.org/r/65786/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/7eb4f1bc Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/7eb4f1bc Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/7eb4f1bc Branch: refs/heads/1.3.x Commit: 7eb4f1bce12ef17bdef1463cd033dfb5026332c2 Parents: b5b0ad1 Author: Greg Mann Authored: Fri Feb 23 16:41:44 2018 -0800 Committer: Gilbert Song Committed: Fri Mar 2 16:57:31 2018 -0800 -- src/docker/docker.cpp | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/mesos/blob/7eb4f1bc/src/docker/docker.cpp -- diff --git a/src/docker/docker.cpp b/src/docker/docker.cpp index 9be1431..3f99293 100755 --- a/src/docker/docker.cpp +++ b/src/docker/docker.cpp @@ -146,8 +146,10 @@ Try> Docker::create( void commandDiscarded(const Subprocess& s, const string& cmd) { - VLOG(1) << "'" << cmd << "' is being discarded"; - os::killtree(s.pid(), SIGKILL); + if (s.status().isPending()) { +VLOG(1) << "'" << cmd << "' is being discarded"; +os::killtree(s.pid(), SIGKILL); + } }
[03/12] mesos git commit: Prevented Docker library from terminating incorrect processes.
Prevented Docker library from terminating incorrect processes. Previously, the Docker library might call `os::killtree()` on a PID after the associated subprocess had already terminated, which could lead to an unknown process being incorrectly killed. Review: https://reviews.apache.org/r/65786/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/e26355f9 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/e26355f9 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/e26355f9 Branch: refs/heads/1.4.x Commit: e26355f91383e37e6e7fe6e58816692db7116303 Parents: ecd0dd8 Author: Greg Mann Authored: Fri Feb 23 16:41:44 2018 -0800 Committer: Gilbert Song Committed: Fri Mar 2 16:55:50 2018 -0800 -- src/docker/docker.cpp | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/mesos/blob/e26355f9/src/docker/docker.cpp -- diff --git a/src/docker/docker.cpp b/src/docker/docker.cpp index 192e170..f0dbd8d 100755 --- a/src/docker/docker.cpp +++ b/src/docker/docker.cpp @@ -148,8 +148,10 @@ Try> Docker::create( void commandDiscarded(const Subprocess& s, const string& cmd) { - VLOG(1) << "'" << cmd << "' is being discarded"; - os::killtree(s.pid(), SIGKILL); + if (s.status().isPending()) { +VLOG(1) << "'" << cmd << "' is being discarded"; +os::killtree(s.pid(), SIGKILL); + } }