[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mesos-commits
Subject:    [mesos] branch 1.4.x updated: Revert "Fixed wrong `mnt` namespace detection for non-command executor
From:       alexr () apache ! org
Date:       2018-08-31 15:14:08
Message-ID: 153572844818.14686.8701795514661010216 () gitbox ! apache ! org
[Download RAW message or body]

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

alexr pushed a commit to branch 1.4.x
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/1.4.x by this push:
     new 18603d4  Revert "Fixed wrong `mnt` namespace detection for non-command \
executor tasks." 18603d4 is described below

commit 18603d454c97e04d26accfad2cc7b62ab38369ff
Author: Alexander Rukletsov <alexr@apache.org>
AuthorDate: Fri Aug 31 17:09:02 2018 +0200

    Revert "Fixed wrong `mnt` namespace detection for non-command executor tasks."
    
    This reverts commit 05ec5d1770aeda25b4995487e40f690fe8fa6b19.
---
 src/slave/containerizer/mesos/containerizer.cpp | 27 ++++++++-----------------
 1 file changed, 8 insertions(+), 19 deletions(-)

diff --git a/src/slave/containerizer/mesos/containerizer.cpp \
b/src/slave/containerizer/mesos/containerizer.cpp index ac7cd6f..5f29fe1 100644
--- a/src/slave/containerizer/mesos/containerizer.cpp
+++ b/src/slave/containerizer/mesos/containerizer.cpp
@@ -1710,31 +1710,20 @@ Future<bool> MesosContainerizerProcess::_launch(
       return Failure("Unknown parent container");
     }
 
-    const Owned<Container>& parentContainer =
-      containers_.at(containerId.parent());
-
-    if (parentContainer->pid.isNone()) {
+    if (containers_.at(containerId.parent())->pid.isNone()) {
       return Failure("Unknown parent container pid");
     }
 
-    const pid_t parentPid = parentContainer->pid.get();
-
-    // For the command executor case, we need to find a PID of its task,
-    // which will be used to enter the task's mount namespace.
-    if (parentContainer->config.isSome() &&
-        parentContainer->config->has_task_info()) {
-      Try<pid_t> mountNamespaceTarget = getMountNamespaceTarget(parentPid);
-      if (mountNamespaceTarget.isError()) {
-        return Failure(
-            "Cannot get target mount namespace from process " +
-            stringify(parentPid) + ": " + mountNamespaceTarget.error());
-      }
+    pid_t parentPid = containers_.at(containerId.parent())->pid.get();
 
-      launchFlags.namespace_mnt_target = mountNamespaceTarget.get();
-    } else {
-      launchFlags.namespace_mnt_target = parentPid;
+    Try<pid_t> mountNamespaceTarget = getMountNamespaceTarget(parentPid);
+    if (mountNamespaceTarget.isError()) {
+      return Failure(
+          "Cannot get target mount namespace from process " +
+          stringify(parentPid) + ": " + mountNamespaceTarget.error());
     }
 
+    launchFlags.namespace_mnt_target = mountNamespaceTarget.get();
     _enterNamespaces = _enterNamespaces.get() & ~CLONE_NEWNS;
   }
 #endif // __linux__


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic