Repository: mesos Updated Branches: refs/heads/master 8b365a487 -> 56513a130
Only log processes in the slave cgroup on recovery. Changes previous behavior where the slave would exit if processes were in the slave cgroup. Review: https://reviews.apache.org/r/33647 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/56513a13 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/56513a13 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/56513a13 Branch: refs/heads/master Commit: 56513a130d497f87caad31b38671defe7ee9e7a0 Parents: 8b365a4 Author: Ian Downes <[email protected]> Authored: Tue Apr 28 16:30:47 2015 -0700 Committer: Ian Downes <[email protected]> Committed: Tue Apr 28 16:48:01 2015 -0700 ---------------------------------------------------------------------- src/slave/slave.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/56513a13/src/slave/slave.cpp ---------------------------------------------------------------------- diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp index c5b4847..c78ee3c 100644 --- a/src/slave/slave.cpp +++ b/src/slave/slave.cpp @@ -242,9 +242,18 @@ void Slave::initialize() << " for slave: " << processes.error(); } - // TODO(idownes): Re-evaluate this behavior if it's observed, - // possibly automatically killing any running processes and - // moving this code to during recovery. + // Log if there are any processes in the slave's cgroup. They + // may be transient helper processes like 'perf' or 'du', + // ancillary processes like 'docker log' or possibly a stuck + // slave. + // TODO(idownes): Generally, it's not a problem if there are + // processes running in the slave's cgroup, though any resources + // consumed by those processes are accounted to the slave. Where + // applicable, transient processes should be configured to + // terminate if the slave exits; see example usage for perf in + // isolators/cgroups/perf.cpp. Consider moving ancillary + // processes to a different cgroup, e.g., moving 'docker log' to + // the container's cgroup. if (!processes.get().empty()) { // For each process, we print its pid as well as its command // to help triaging. @@ -260,10 +269,10 @@ void Slave::initialize() } } - EXIT(1) << "A slave (or child process) is still running, " - << "please check the following process(es) listed in " - << path::join(hierarchy.get(), cgroup, "cgroups.proc") - << ":\n" << strings::join("\n", infos); + LOG(INFO) << "A slave (or child process) is still running, please" + << " consider checking the following process(es) listed in " + << path::join(hierarchy.get(), cgroup, "cgroups.proc") + << ":\n" << strings::join("\n", infos); } // Move all of our threads into the cgroup.
