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 648d003a4 [cgroups2] Only call isolate() on controllers of containers 
with isolate == true.
648d003a4 is described below

commit 648d003a44243dc39519a83c917f89927d2c162b
Author: Jason Zhou <[email protected]>
AuthorDate: Thu Aug 15 18:25:06 2024 -0400

    [cgroups2] Only call isolate() on controllers of containers with isolate == 
true.
    
    In cgroups1, when handling nested containers that share cgroups, we
    skip isolate calls for them. We want to replicate this behavior in
    cgroups2.
    
    Review: https://reviews.apache.org/r/75173/
---
 src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.cpp 
b/src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.cpp
index 3718621f4..8c116dcfb 100644
--- a/src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.cpp
+++ b/src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.cpp
@@ -632,6 +632,14 @@ Future<Nothing> Cgroups2IsolatorProcess::isolate(
     const ContainerID& containerId,
     pid_t pid)
 {
+  if (!infos.contains(containerId)) {
+    return Failure("Unknown container '" + stringify(containerId) + "'");
+  }
+
+  if (infos[containerId]->isolate) {
+    return Nothing();
+  }
+
   vector<Future<Nothing>> isolates;
 
   // Move the process into the container's cgroup.

Reply via email to