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:55 GMT
Repository: storm
Updated Branches:
  refs/heads/master e8d681b51 -> 5e0ece353


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

* Closes #1758


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

Branch: refs/heads/master
Commit: 5f5a482b4be316719be2334cf2ca30b2a0fc6049
Parents: e8d681b
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 22:49:30 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/5f5a482b/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