You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2016/02/20 17:37:46 UTC

[10/11] mesos git commit: Fixed health check process leak when shutdown is called without killTask.

Fixed health check process leak when shutdown is called without killTask.


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

Branch: refs/heads/master
Commit: 25d303d8743b524c92627d48f7dfb7ac2a921ede
Parents: a30233b
Author: Benjamin Mahler <bm...@apache.org>
Authored: Sat Feb 20 15:31:28 2016 +0100
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Sat Feb 20 17:32:26 2016 +0100

----------------------------------------------------------------------
 src/docker/executor.cpp   | 14 ++++++++++----
 src/launcher/executor.cpp | 14 ++++++++++----
 2 files changed, 20 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/25d303d8/src/docker/executor.cpp
----------------------------------------------------------------------
diff --git a/src/docker/executor.cpp b/src/docker/executor.cpp
index cab9d80..1921d4a 100644
--- a/src/docker/executor.cpp
+++ b/src/docker/executor.cpp
@@ -195,10 +195,6 @@ public:
     // Since the docker executor manages a single task, we
     // shutdown completely when we receive a killTask.
     shutdown(driver);
-    if (healthPid != -1) {
-      // Cleanup health check process.
-      os::killtree(healthPid, SIGKILL);
-    }
   }
 
   void frameworkMessage(ExecutorDriver* driver, const string& data) {}
@@ -230,6 +226,16 @@ public:
       stop = docker->stop(containerName, stopTimeout);
       killed = true;
     }
+
+    // Cleanup health check process.
+    //
+    // TODO(bmahler): Consider doing this after the task has been
+    // reaped, since a framework may be interested in health
+    // information while the task is being killed (consider a
+    // task that takes 30 minutes to be cleanly killed).
+    if (healthPid != -1) {
+      os::killtree(healthPid, SIGKILL);
+    }
   }
 
   void error(ExecutorDriver* driver, const string& message) {}

http://git-wip-us.apache.org/repos/asf/mesos/blob/25d303d8/src/launcher/executor.cpp
----------------------------------------------------------------------
diff --git a/src/launcher/executor.cpp b/src/launcher/executor.cpp
index b65f0ab..4149f08 100644
--- a/src/launcher/executor.cpp
+++ b/src/launcher/executor.cpp
@@ -464,10 +464,6 @@ public:
     // Since the command executor manages a single task, we
     // shutdown completely when we receive a killTask.
     shutdown(driver);
-    if (healthPid != -1) {
-      // Cleanup health check process.
-      os::killtree(healthPid, SIGKILL);
-    }
   }
 
   void frameworkMessage(ExecutorDriver* driver, const string& data) {}
@@ -521,6 +517,16 @@ public:
 
       killed = true;
     }
+
+    // Cleanup health check process.
+    //
+    // TODO(bmahler): Consider doing this after the task has been
+    // reaped, since a framework may be interested in health
+    // information while the task is being killed (consider a
+    // task that takes 30 minutes to be cleanly killed).
+    if (healthPid != -1) {
+      os::killtree(healthPid, SIGKILL);
+    }
   }
 
   virtual void error(ExecutorDriver* driver, const string& message) {}