You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ya...@apache.org on 2016/07/06 21:54:08 UTC
[3/5] mesos git commit: Fixed Mesos containerizer to set container
FETCHING state.
Fixed Mesos containerizer to set container FETCHING state.
If the container state is not properly set to FETCHING, Mesos agent
cannot detect the terminated executor when the fetcher times out.
Review: https://reviews.apache.org/r/49650
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/114474c4
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/114474c4
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/114474c4
Branch: refs/heads/master
Commit: 114474c443678997da8f931a41703f1095206421
Parents: b16dbb2
Author: Jiang Yan Xu <xu...@apple.com>
Authored: Fri Jul 1 15:27:37 2016 -0700
Committer: Jiang Yan Xu <xu...@apple.com>
Committed: Wed Jul 6 14:53:46 2016 -0700
----------------------------------------------------------------------
src/slave/containerizer/mesos/containerizer.cpp | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/114474c4/src/slave/containerizer/mesos/containerizer.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/containerizer.cpp b/src/slave/containerizer/mesos/containerizer.cpp
index f53b01b..5a6ec85 100644
--- a/src/slave/containerizer/mesos/containerizer.cpp
+++ b/src/slave/containerizer/mesos/containerizer.cpp
@@ -1052,6 +1052,12 @@ Future<Nothing> MesosContainerizerProcess::fetch(
return Failure("Container is already destroyed");
}
+ if (containers_[containerId]->state == DESTROYING) {
+ return Failure("Container is currently being destroyed");
+ }
+
+ containers_[containerId]->state = FETCHING;
+
return fetcher->fetch(
containerId,
commandInfo,
@@ -1620,10 +1626,6 @@ void MesosContainerizerProcess::destroy(
return;
}
- if (container->state == FETCHING) {
- fetcher->kill(containerId);
- }
-
if (container->state == ISOLATING) {
VLOG(1) << "Waiting for the isolators to complete for container '"
<< containerId << "'";
@@ -1638,6 +1640,11 @@ void MesosContainerizerProcess::destroy(
return;
}
+ // Either RUNNING or FETCHING at this point.
+ if (container->state == FETCHING) {
+ fetcher->kill(containerId);
+ }
+
container->state = DESTROYING;
_destroy(containerId);
}