You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by nn...@apache.org on 2014/05/14 21:08:16 UTC
git commit: Fixed concurrent wait within the ExternalContainerizer.
Repository: mesos
Updated Branches:
refs/heads/master 377ec0e93 -> 2ac0c1695
Fixed concurrent wait within the ExternalContainerizer.
The ECP must not receive multiple, concurrent wait-invocations on the
same ContainerID.
This fix checks if a wait-invocation is already active by checking if
the wait-PID is setup (isSome). If that is the case, the EC simply
returns the future of the termination without additionally invoking
the ECP.
Review: https://reviews.apache.org/r/21328
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/2ac0c169
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/2ac0c169
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/2ac0c169
Branch: refs/heads/master
Commit: 2ac0c169593ef005a231ca4e6fcbda3f0fc78703
Parents: 377ec0e
Author: Till Toenshoff <to...@me.com>
Authored: Wed May 14 11:43:12 2014 -0700
Committer: Niklas Q. Nielsen <ni...@mesosphere.io>
Committed: Wed May 14 11:43:12 2014 -0700
----------------------------------------------------------------------
src/slave/containerizer/external_containerizer.cpp | 7 +++++++
1 file changed, 7 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/2ac0c169/src/slave/containerizer/external_containerizer.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/external_containerizer.cpp b/src/slave/containerizer/external_containerizer.cpp
index 2ff19b1..f9811c4 100644
--- a/src/slave/containerizer/external_containerizer.cpp
+++ b/src/slave/containerizer/external_containerizer.cpp
@@ -521,6 +521,13 @@ Future<containerizer::Termination> ExternalContainerizerProcess::_wait(
return Failure("Container '" + containerId.value() + "' not running");
}
+ // We must not run multiple 'wait' invocations concurrently on the
+ // same container.
+ if (actives[containerId]->pid.isSome()) {
+ VLOG(2) << "Already waiting for " << containerId;
+ return actives[containerId]->termination.future();
+ }
+
containerizer::Wait wait;
wait.mutable_container_id()->CopyFrom(containerId);