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.



Branch: refs/heads/master
Commit: 63004cc49644e229adf9581794ee21f89f66b898
Parents: 66e0c5b
Author: Kevin Klues <>
Authored: Sat Sep 17 13:01:31 2016 -0700
Committer: Jie Yu <>
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(-)
diff --git a/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