You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by qi...@apache.org on 2018/02/14 12:49:22 UTC
[6/7] mesos git commit: Removed outdated executor-wide launched flag
from the default executor.
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/632ff7f7
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/632ff7f7
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/632ff7f7
Branch: refs/heads/master
Commit: 632ff7f7f8e32d3f9507e9199c8a253ff755224e
Parents: 54b6c5b
Author: Gaston Kleiman <ga...@mesosphere.io>
Authored: Wed Feb 14 14:35:34 2018 +0800
Committer: Qian Zhang <zh...@gmail.com>
Committed: Wed Feb 14 20:37:31 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/632ff7f7/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;