storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kabh...@apache.org
Subject [1/3] storm git commit: STORM-2185: Storm Supervisor doesn't delete directories properly sometimes
Date Mon, 07 Nov 2016 14:05:50 GMT
Repository: storm
Updated Branches:
  refs/heads/1.x-branch c760e1395 -> bf8437c20


STORM-2185: Storm Supervisor doesn't delete directories properly sometimes

* Closes #1759


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

Branch: refs/heads/1.x-branch
Commit: e18f0ae63dad71af31971ab5801495ba9c0ce2e3
Parents: c760e13
Author: Kyle Nusbaum <knusbaum@yahoo-inc.com>
Authored: Wed Nov 2 15:29:53 2016 -0500
Committer: Jungtaek Lim <kabhwan@gmail.com>
Committed: Mon Nov 7 23:02:15 2016 +0900

----------------------------------------------------------------------
 .../org/apache/storm/daemon/supervisor/AdvancedFSOps.java   | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/e18f0ae6/storm-core/src/jvm/org/apache/storm/daemon/supervisor/AdvancedFSOps.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/daemon/supervisor/AdvancedFSOps.java b/storm-core/src/jvm/org/apache/storm/daemon/supervisor/AdvancedFSOps.java
index e531b84..4b96197 100644
--- a/storm-core/src/jvm/org/apache/storm/daemon/supervisor/AdvancedFSOps.java
+++ b/storm-core/src/jvm/org/apache/storm/daemon/supervisor/AdvancedFSOps.java
@@ -86,8 +86,15 @@ public class AdvancedFSOps {
             commands.add("rmr");
             commands.add(absolutePath);
             SupervisorUtils.processLauncherAndWait(_conf, user, commands, null, logPrefix);
+
             if (Utils.checkFileExists(absolutePath)) {
-                throw new RuntimeException(path + " was not deleted.");
+                // It's possible that permissions were not set properly on the directory,
and
+                // the user who is *supposed* to own the dir does not. In this case, try
the
+                // delete as the supervisor user.
+                Utils.forceDelete(absolutePath);
+                if (Utils.checkFileExists(absolutePath)) {
+                    throw new RuntimeException(path + " was not deleted.");
+                }
             }
         }
         


Mime
View raw message