This is an automated email from the ASF dual-hosted git repository.

bmahler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new 65d246fe8 [cgroups2] Do DEBUG container check after creating cgroup 
for it.
65d246fe8 is described below

commit 65d246fe82093fdf393d4379917872a9d839fc9c
Author: Jason Zhou <[email protected]>
AuthorDate: Thu Aug 15 18:22:15 2024 -0400

    [cgroups2] Do DEBUG container check after creating cgroup for it.
    
    Since we create cgroups for all containers, we will create the DEBUG
    container. We expect the DEBUG containers to not have its own resource
    contraints, so we will return __prepare early before reaching the
    CHECK.
    
    Review: https://reviews.apache.org/r/75172/
---
 src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.cpp 
b/src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.cpp
index 2bf253874..3718621f4 100644
--- a/src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.cpp
+++ b/src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.cpp
@@ -182,7 +182,6 @@ Future<Option<ContainerLaunchInfo>> 
Cgroups2IsolatorProcess::prepare(
                    " has already been prepared");
   }
 
-  CHECK(containerConfig.container_class() != ContainerClass::DEBUG);
 
   // Based on MESOS-9305, there seems to be a possibility that the root
   // folder may be deleted underneath us. Since we make use of subtree_control
@@ -232,6 +231,12 @@ Future<Option<ContainerLaunchInfo>> 
Cgroups2IsolatorProcess::prepare(
   infos[containerId] = Owned<Info>(
       new Info(containerId, nonLeafCgroup, leafCgroup, !shareCgroups));
 
+  if (shareCgroups) {
+    return __prepare(containerId, containerConfig);
+  }
+
+  CHECK(containerConfig.container_class() != ContainerClass::DEBUG);
+
   vector<Future<Nothing>> prepares;
   hashset<string> skip_enable = {"core", "perf_event", "devices"};
   foreachvalue (const Owned<Controller>& controller, controllers) {

Reply via email to