You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by al...@apache.org on 2017/03/15 21:21:10 UTC

[09/13] mesos git commit: Renamed health checker in command executor for clarity.

Renamed health checker in command executor for clarity.

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


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

Branch: refs/heads/master
Commit: 6b332ade085de92ba0ae29856e2b1990e4ea14b8
Parents: a352bbf
Author: Alexander Rukletsov <al...@apache.org>
Authored: Fri Jan 27 18:23:37 2017 +0100
Committer: Alexander Rukletsov <al...@apache.org>
Committed: Wed Mar 15 22:20:20 2017 +0100

----------------------------------------------------------------------
 src/launcher/executor.cpp | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/6b332ade/src/launcher/executor.cpp
----------------------------------------------------------------------
diff --git a/src/launcher/executor.cpp b/src/launcher/executor.cpp
index c9243a4..57e4a32 100644
--- a/src/launcher/executor.cpp
+++ b/src/launcher/executor.cpp
@@ -292,6 +292,9 @@ protected:
 
   void taskHealthUpdated(const TaskHealthStatus& healthStatus)
   {
+    CHECK_SOME(taskId);
+    CHECK_EQ(taskId.get(), healthStatus.task_id());
+
     // This prevents us from sending health updates after a terminal
     // status update, because we may receive an update from a health
     // check scheduled before the task has been reaped.
@@ -485,7 +488,7 @@ protected:
         namespaces.push_back("mnt");
       }
 
-      Try<Owned<checks::HealthChecker>> _checker =
+      Try<Owned<checks::HealthChecker>> _healthChecker =
         checks::HealthChecker::create(
             unacknowledgedTask->health_check(),
             launcherDir,
@@ -494,12 +497,12 @@ protected:
             pid,
             namespaces);
 
-      if (_checker.isError()) {
+      if (_healthChecker.isError()) {
         // TODO(gilbert): Consider ABORT and return a TASK_FAILED here.
         cerr << "Failed to create health checker: "
-             << _checker.error() << endl;
+             << _healthChecker.error() << endl;
       } else {
-        checker = _checker.get();
+        healthChecker = _healthChecker.get();
       }
     }
 
@@ -633,8 +636,8 @@ private:
       }
 
       // Stop health checking the task.
-      if (checker.get() != nullptr) {
-        checker->stop();
+      if (healthChecker.get() != nullptr) {
+        healthChecker->stop();
       }
 
       // Now perform signal escalation to begin killing the task.
@@ -673,8 +676,8 @@ private:
     terminated = true;
 
     // Stop health checking the task.
-    if (checker.get() != nullptr) {
-      checker->stop();
+    if (healthChecker.get() != nullptr) {
+      healthChecker->stop();
     }
 
     TaskState taskState;
@@ -883,7 +886,7 @@ private:
 
   Option<TaskStatus> lastTaskStatus;
 
-  Owned<checks::HealthChecker> checker;
+  Owned<checks::HealthChecker> healthChecker;
 };
 
 } // namespace internal {