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 2017/05/09 07:56:20 UTC

mesos git commit: Fixed provisioner recover blockage by non-existing rootfses dir.

Repository: mesos
Updated Branches:
  refs/heads/master 8f7acb5a1 -> 64cb24fc7


Fixed provisioner recover blockage by non-existing rootfses dir.

In provisioner recover, when listing the container rootfses, it is
possible that the 'rootfses' dir does not exist. Because a possible
race between the provisioner destroy and the agent restart. For
instance, while the provisioner is destroying the container dir the
agent restarts. Due to os::rmdir() is recursive by traversing the
FTS tree, it is possible that 'rootfses' dir is removed but the
others (e.g., scratch dir) are not.

Currently, we are returning an error if the 'rootfses' dir does not
exist, which blocks the agent from recovery. We should skip it if
'rootfses' does not exist.

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


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

Branch: refs/heads/master
Commit: 64cb24fc75ef41e0760649891ea1bb62d6fe9b11
Parents: 8f7acb5
Author: Gilbert Song <so...@gmail.com>
Authored: Tue May 9 09:56:13 2017 +0200
Committer: Jie Yu <yu...@gmail.com>
Committed: Tue May 9 09:56:13 2017 +0200

----------------------------------------------------------------------
 src/slave/containerizer/mesos/provisioner/paths.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/64cb24fc/src/slave/containerizer/mesos/provisioner/paths.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/provisioner/paths.cpp b/src/slave/containerizer/mesos/provisioner/paths.cpp
index d2de98b..268dbeb 100644
--- a/src/slave/containerizer/mesos/provisioner/paths.cpp
+++ b/src/slave/containerizer/mesos/provisioner/paths.cpp
@@ -206,7 +206,13 @@ Try<hashmap<string, hashset<string>>> listContainerRootfses(
       continue;
     }
 
-    Try<list<string>> rootfses = os::ls(getRootfsesDir(backendDir));
+    string rootfsesDir = getRootfsesDir(backendDir);
+    if (!os::stat::isdir(rootfsesDir)) {
+      LOG(WARNING) << "Ignoring unexpected rootfses at: " << rootfsesDir;
+      continue;
+    }
+
+    Try<list<string>> rootfses = os::ls(rootfsesDir);
     if (rootfses.isError()) {
       return Error("Unable to list the backend directory: " + rootfses.error());
     }