You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2016/03/28 18:19:13 UTC

[7/7] mesos git commit: Subprocess: [7/7] Added watchdog to 'du' disk isolator process.

Subprocess: [7/7] Added watchdog to 'du' disk isolator process.

The disk isolator process should also be killed when
the parent process dies.

Review: https://reviews.apache.org/r/45245/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/5914f571
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/5914f571
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/5914f571

Branch: refs/heads/master
Commit: 5914f571ea569777c8bda497a3eb1e6878ea8eb5
Parents: 0e2895c
Author: Joerg Schad <jo...@mesosphere.io>
Authored: Mon Mar 28 17:35:19 2016 +0200
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Mon Mar 28 18:17:25 2016 +0200

----------------------------------------------------------------------
 src/slave/containerizer/mesos/isolators/posix/disk.cpp | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/5914f571/src/slave/containerizer/mesos/isolators/posix/disk.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/posix/disk.cpp b/src/slave/containerizer/mesos/isolators/posix/disk.cpp
index f32c2c3..dde958b 100644
--- a/src/slave/containerizer/mesos/isolators/posix/disk.cpp
+++ b/src/slave/containerizer/mesos/isolators/posix/disk.cpp
@@ -487,13 +487,21 @@ private:
     // Add path on which 'du' must be run.
     command.push_back(entry->path);
 
-    // TODO(joerg84): Add correct killing behavior.
+    // NOTE: The monitor watchdog will watch the parent process and kill
+    // the 'du' process in case that the parent die.
     Try<Subprocess> s = subprocess(
         "du",
         command,
         Subprocess::PATH("/dev/null"),
         Subprocess::PIPE(),
-        Subprocess::PIPE());
+        Subprocess::PIPE(),
+        process::NO_SETSID,
+        None(),
+        None(),
+        None(),
+        Subprocess::Hook::None(),
+        None(),
+        process::MONITOR);
 
     if (s.isError()) {
       entry->promise.fail("Failed to exec 'du': " + s.error());