Repository: mesos
Updated Branches:
  refs/heads/master 2f3ceb451 -> 0292d4216


Updated error messages in `getMountNamespaceTarget()`.

Previously, `getMountNamespaceTarget()` ignored error messages
returned by `ns::getns()` and `os::children()`.

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


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

Branch: refs/heads/master
Commit: 0292d4216306a9758610a8f0e4e41ed2c458d097
Parents: 2f3ceb4
Author: Andrei Budnik <[email protected]>
Authored: Tue Oct 3 06:30:24 2017 -0400
Committer: Alexander Rukletsov <[email protected]>
Committed: Tue Oct 3 06:30:24 2017 -0400

----------------------------------------------------------------------
 src/slave/containerizer/mesos/utils.cpp | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/0292d421/src/slave/containerizer/mesos/utils.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/utils.cpp 
b/src/slave/containerizer/mesos/utils.cpp
index be8126d..ec6d6c7 100644
--- a/src/slave/containerizer/mesos/utils.cpp
+++ b/src/slave/containerizer/mesos/utils.cpp
@@ -60,22 +60,22 @@ Try<pid_t> getMountNamespaceTarget(pid_t parent)
 {
   Try<ino_t> parentNamespace = ns::getns(parent, "mnt");
   if (parentNamespace.isError()) {
-    return Error("Cannot get 'mnt' namespace for"
-                 " process '" + stringify(parent) + "'");
+    return Error("Cannot get 'mnt' namespace for process"
+                 " '" + stringify(parent) + "': " + parentNamespace.error());
   }
 
   // Search for a new mount namespace in all direct children.
   Try<set<pid_t>> children = os::children(parent, false);
   if (children.isError()) {
     return Error("Cannot get children for process"
-                 " '" + stringify(parent) + "'");
+                 " '" + stringify(parent) + "': " + children.error());
   }
 
   foreach (pid_t child, children.get()) {
     Try<ino_t> childNamespace = ns::getns(child, "mnt");
     if (childNamespace.isError()) {
-      return Error("Cannot get 'mnt' namespace for"
-                   " child process '" + stringify(child) + "'");
+      return Error("Cannot get 'mnt' namespace for child process"
+                   " '" + stringify(child) + "': " + childNamespace.error());
     }
 
     if (parentNamespace.get() != childNamespace.get()) {
@@ -89,14 +89,15 @@ Try<pid_t> getMountNamespaceTarget(pid_t parent)
     if (children2.isError()) {
       return Error("Cannot get 2nd-level children for process"
                    " '" + stringify(parent) + "' with child"
-                   " '" + stringify(child) + "'");
+                   " '" + stringify(child) + "': " + children2.error());
     }
 
     foreach (pid_t child2, children2.get()) {
       Try<ino_t> child2Namespace = ns::getns(child2, "mnt");
       if (child2Namespace.isError()) {
-        return Error("Cannot get 'mnt' namespace for 2nd-level"
-                     " child process '" + stringify(child2) + "'");
+        return Error("Cannot get 'mnt' namespace for 2nd-level child process"
+                     " '" + stringify(child2) +
+                     "': " + child2Namespace.error());
       }
 
       if (parentNamespace.get() != child2Namespace.get()) {

Reply via email to