Repository: mesos
Updated Branches:
  refs/heads/master 66e0c5bdf -> 63004cc49


Updated 'cgroups' isolator 'watch' to be properly nested aware.

In a previous iteration of attempting to make this isolator nested
aware, we (incorrectly) decided to return a 'Failure()' in 'watch()'
for nested containers. However, we shouldn't just blindly fail this
call for nested containers. Instead we should just return a 'Future'
that will never be satisfied. This way it is safe to call 'watch()'
for nested containers, without any unwanted side effects.

This commit fixes this issue.

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


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

Branch: refs/heads/master
Commit: 63004cc49644e229adf9581794ee21f89f66b898
Parents: 66e0c5b
Author: Kevin Klues <klue...@gmail.com>
Authored: Sat Sep 17 13:01:31 2016 -0700
Committer: Jie Yu <yujie....@gmail.com>
Committed: Sat Sep 17 13:01:31 2016 -0700

----------------------------------------------------------------------
 src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/63004cc4/src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp 
b/src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp
index ed7150a..937356b 100644
--- a/src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp
+++ b/src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp
@@ -595,8 +595,11 @@ Future<Nothing> CgroupsIsolatorProcess::_isolate(
 Future<ContainerLimitation> CgroupsIsolatorProcess::watch(
     const ContainerID& containerId)
 {
+  // Since we do not maintain cgroups for nested containers
+  // directly, we simply return a pending future here, indicating
+  // that the limit for the nested container will never be reached.
   if (containerId.has_parent()) {
-    return Failure("Not supported for nested containers");
+    return Future<ContainerLimitation>();
   }
 
   if (!infos.contains(containerId)) {

Reply via email to