Removed outdated executor-wide launched flag from the default executor.

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


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

Branch: refs/heads/1.5.x
Commit: 4b4d7376059167f38e08e0e6bbcbbe3480973b5d
Parents: f9f8d6b
Author: Gaston Kleiman <gas...@mesosphere.io>
Authored: Wed Feb 14 14:35:34 2018 +0800
Committer: Qian Zhang <zhq527...@gmail.com>
Committed: Wed Feb 14 21:06:40 2018 +0800

----------------------------------------------------------------------
 src/launcher/default_executor.cpp | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/4b4d7376/src/launcher/default_executor.cpp
----------------------------------------------------------------------
diff --git a/src/launcher/default_executor.cpp 
b/src/launcher/default_executor.cpp
index ff437bc..8720dad 100644
--- a/src/launcher/default_executor.cpp
+++ b/src/launcher/default_executor.cpp
@@ -114,7 +114,7 @@ private:
     // TODO(bennoe): Create a real state machine instead of adding
     // more and more ad-hoc boolean values.
 
-    // Indicates whether a container has been launched.
+    // Indicates whether the child container has been launched.
     bool launched;
 
     // Indicates whether a status update acknowledgement
@@ -139,7 +139,6 @@ public:
     : ProcessBase(process::ID::generate("default-executor")),
       state(DISCONNECTED),
       contentType(ContentType::PROTOBUF),
-      launched(false),
       shuttingDown(false),
       unhealthy(false),
       frameworkInfo(None()),
@@ -207,7 +206,7 @@ public:
         // It is possible that the agent process had failed after we
         // had launched the child containers. We can resume waiting on the
         // child containers again.
-        if (launched) {
+        if (!containers.empty()) {
           wait(containers.keys());
         }
 
@@ -349,8 +348,6 @@ protected:
   {
     CHECK_EQ(SUBSCRIBED, state);
 
-    launched = true;
-
     process::http::connect(agent)
       .onAny(defer(self(), &Self::_launchGroup, taskGroup, lambda::_1));
   }
@@ -540,7 +537,6 @@ protected:
       return;
     }
 
-    CHECK(launched);
     CHECK_EQ(containerIds.size(), (size_t) taskGroup.tasks().size());
     CHECK_EQ(containerIds.size(), responses->size());
 
@@ -666,7 +662,7 @@ protected:
   void wait(const list<TaskID>& taskIds)
   {
     CHECK_EQ(SUBSCRIBED, state);
-    CHECK(launched);
+    CHECK(!containers.empty());
     CHECK_SOME(connectionId);
 
     LOG(INFO) << "Waiting on child containers of tasks " << stringify(taskIds);
@@ -1014,7 +1010,7 @@ protected:
 
     shuttingDown = true;
 
-    if (!launched) {
+    if (containers.empty()) {
       _shutdown();
       return;
     }
@@ -1550,7 +1546,6 @@ private:
   } state;
 
   const ContentType contentType;
-  bool launched;
   bool shuttingDown;
   bool unhealthy; // Set to true if any of the tasks are reported unhealthy.
   Option<FrameworkInfo> frameworkInfo;

Reply via email to