mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ji...@apache.org
Subject [1/2] mesos git commit: Preventing agent recovery failing from unsuccessful `docker rm`.
Date Fri, 14 Jul 2017 21:50:08 GMT
Repository: mesos
Updated Branches:
  refs/heads/1.3.x 3b69dca42 -> 336306209


Preventing agent recovery failing from unsuccessful `docker rm`.

This patch changes the semancits of `Docker::stop()` to do a best-effort
`docker rm` and log the error instead of returning the failure, as a
workaround of the mount namespace leakage issue in Docker 1.12/1.13.

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


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

Branch: refs/heads/1.3.x
Commit: a8bf90ba1d3f46d4932d75351987b68449a5923c
Parents: 3b69dca
Author: Chun-Hung Hsiao <chhsiao@mesosphere.io>
Authored: Fri Jul 14 13:57:24 2017 -0700
Committer: Jie Yu <yujie.jay@gmail.com>
Committed: Fri Jul 14 14:44:26 2017 -0700

----------------------------------------------------------------------
 src/docker/docker.cpp | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/a8bf90ba/src/docker/docker.cpp
----------------------------------------------------------------------
diff --git a/src/docker/docker.cpp b/src/docker/docker.cpp
index 236443e..9be1431 100755
--- a/src/docker/docker.cpp
+++ b/src/docker/docker.cpp
@@ -933,7 +933,10 @@ Future<Option<int>> Docker::run(
   return s->status();
 }
 
-
+// NOTE: A known issue in Docker 1.12/1.13 sometimes leaks its mount
+// namespace, causing `docker rm` to fail. As a workaround, we do a
+// best-effort `docker rm` and log the error insteaf of return a
+// failure when `remove` is set to true (MESOS-7777).
 Future<Nothing> Docker::stop(
     const string& containerName,
     const Duration& timeout,
@@ -981,7 +984,12 @@ Future<Nothing> Docker::_stop(
 
   if (remove) {
     bool force = !status.isSome() || status.get() != 0;
-    return docker.rm(containerName, force);
+    return docker.rm(containerName, force)
+      .repair([=](const Future<Nothing>& future) {
+        LOG(ERROR) << "Unable to remove Docker container '"
+                   << containerName + "': " << future.failure();
+        return Nothing();
+      });
   }
 
   return checkError(cmd, s);


Mime
View raw message