You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2016/02/18 00:06:33 UTC

[1/2] mesos git commit: Introduced `Sequence` in container.

Repository: mesos
Updated Branches:
  refs/heads/master 4107f14e3 -> b45b9df71


Introduced `Sequence` in container.

The `Sequence` will be used to serialize the invocation for status
requests from isolators for a given container.

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


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

Branch: refs/heads/master
Commit: 95a8fc34057795a04354e562e4f4f995a311c1e6
Parents: 4107f14
Author: Avinash sridharan <av...@mesosphere.io>
Authored: Wed Feb 17 15:04:45 2016 -0800
Committer: Jie Yu <yu...@gmail.com>
Committed: Wed Feb 17 15:04:45 2016 -0800

----------------------------------------------------------------------
 src/slave/containerizer/mesos/containerizer.hpp | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/95a8fc34/src/slave/containerizer/mesos/containerizer.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/containerizer.hpp b/src/slave/containerizer/mesos/containerizer.hpp
index 7aa53f6..3ef6a67 100644
--- a/src/slave/containerizer/mesos/containerizer.hpp
+++ b/src/slave/containerizer/mesos/containerizer.hpp
@@ -20,14 +20,16 @@
 #include <list>
 #include <vector>
 
-#include <mesos/slave/container_logger.hpp>
-#include <mesos/slave/isolator.hpp>
+#include <process/sequence.hpp>
 
 #include <process/metrics/counter.hpp>
 
 #include <stout/hashmap.hpp>
 #include <stout/multihashmap.hpp>
 
+#include <mesos/slave/container_logger.hpp>
+#include <mesos/slave/isolator.hpp>
+
 #include "slave/state.hpp"
 
 #include "slave/containerizer/containerizer.hpp"
@@ -323,6 +325,11 @@ private:
     std::string directory;
 
     State state;
+
+    // Used when `status` needs to be collected from isolators
+    // associated with this container. `Sequence` allows us to
+    // maintain the order of `status` requests for a given container.
+    process::Sequence sequence;
   };
 
   hashmap<ContainerID, process::Owned<Container>> containers_;


[2/2] mesos git commit: Searialized invocation of `await` in the status method.

Posted by ji...@apache.org.
Searialized invocation of `await` in the status method.

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


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

Branch: refs/heads/master
Commit: b45b9df715aa191722f22e57a15de3e6fbf22a4b
Parents: 95a8fc3
Author: Avinash sridharan <av...@mesosphere.io>
Authored: Wed Feb 17 15:04:59 2016 -0800
Committer: Jie Yu <yu...@gmail.com>
Committed: Wed Feb 17 15:06:19 2016 -0800

----------------------------------------------------------------------
 src/slave/containerizer/mesos/containerizer.cpp | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b45b9df7/src/slave/containerizer/mesos/containerizer.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/containerizer.cpp b/src/slave/containerizer/mesos/containerizer.cpp
index 3de214d..129406a 100644
--- a/src/slave/containerizer/mesos/containerizer.cpp
+++ b/src/slave/containerizer/mesos/containerizer.cpp
@@ -1345,9 +1345,18 @@ Future<ContainerStatus> MesosContainerizerProcess::status(
     futures.push_back(isolator->status(containerId));
   }
 
-  // Using `await()` here so we can return partial status.
-  return await(futures).then(
-      lambda::bind(_status, containerId, lambda::_1));
+  // We are using `await` here since we are interested in partial
+  // results from calls to `isolator->status`. We also need to
+  // serialize the invocation to `await` in order to maintain the
+  // order of requests for `ContainerStatus` by the agent.  See
+  // MESOS-4671 for more details.
+  VLOG(2) << "Serializing status request for container: " << containerId;
+
+  return containers_[containerId]->sequence.add<ContainerStatus>(
+      [=]() -> Future<ContainerStatus> {
+        return await(futures)
+          .then(lambda::bind(_status, containerId, lambda::_1));
+      });
 }