You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2016/08/25 18:45:30 UTC

[4/8] mesos git commit: Printed all the isolator cleanup errors during destory.

Printed all the isolator cleanup errors during destory.

The current code only prints the first error.

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


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

Branch: refs/heads/master
Commit: 72c9f2deef6d306265c8209bf9a9711fde9756dc
Parents: 627c646
Author: Jie Yu <yu...@gmail.com>
Authored: Wed Aug 24 18:35:11 2016 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Thu Aug 25 11:45:23 2016 -0700

----------------------------------------------------------------------
 src/slave/containerizer/mesos/containerizer.cpp | 28 ++++++++++++--------
 1 file changed, 17 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/72c9f2de/src/slave/containerizer/mesos/containerizer.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/containerizer.cpp b/src/slave/containerizer/mesos/containerizer.cpp
index 0b82a47..7a0b4ba 100644
--- a/src/slave/containerizer/mesos/containerizer.cpp
+++ b/src/slave/containerizer/mesos/containerizer.cpp
@@ -1727,19 +1727,26 @@ void MesosContainerizerProcess::____destroy(
   const Owned<Container>& container = containers_[containerId];
 
   // Check cleanup succeeded for all isolators. If not, we'll fail the
-  // container termination and remove the 'destroying' flag but leave
-  // all other state. The container is now in an inconsistent state.
+  // container termination and remove the container from the map.
+  vector<string> errors;
+
   foreach (const Future<Nothing>& cleanup, cleanups.get()) {
     if (!cleanup.isReady()) {
-      container->promise.fail(
-          "Failed to clean up an isolator when destroying container: " +
-          (cleanup.isFailed() ? cleanup.failure() : "discarded"));
+      errors.push_back(cleanup.isFailed()
+        ? cleanup.failure()
+        : "discarded");
+    }
+  }
 
-      containers_.erase(containerId);
+  if (!errors.empty()) {
+    container->promise.fail(
+        "Failed to clean up an isolator when destroying container: " +
+        strings::join("; ", errors));
 
-      ++metrics.container_destroy_errors;
-      return;
-    }
+    containers_.erase(containerId);
+
+    ++metrics.container_destroy_errors;
+    return;
   }
 
   provisioner->destroy(containerId)
@@ -1757,8 +1764,7 @@ void MesosContainerizerProcess::_____destroy(
 
   if (!destroy.isReady()) {
     container->promise.fail(
-        "Failed to destroy the provisioned filesystem when destroying "
-        "container '" + stringify(containerId) + "': " +
+        "Failed to destroy the provisioned rootfs when destroying container: " +
         (destroy.isFailed() ? destroy.failure() : "discarded future"));
 
     containers_.erase(containerId);