You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2016/03/22 20:45:10 UTC

[2/4] storm git commit: moving cgroups cleanup code to a better place so that retry will happen if failure occurs at cleanup

moving cgroups cleanup code to a better place so that retry will happen if failure occurs at cleanup


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

Branch: refs/heads/master
Commit: 3b4a4e3b8ea2fcaf0c1d58fb3abcec2966752369
Parents: f679dac
Author: Boyang Jerry Peng <je...@yahoo-inc.com>
Authored: Tue Mar 15 23:42:27 2016 -0500
Committer: Boyang Jerry Peng <je...@yahoo-inc.com>
Committed: Tue Mar 15 23:42:27 2016 -0500

----------------------------------------------------------------------
 storm-core/src/clj/org/apache/storm/daemon/supervisor.clj | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/3b4a4e3b/storm-core/src/clj/org/apache/storm/daemon/supervisor.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/daemon/supervisor.clj b/storm-core/src/clj/org/apache/storm/daemon/supervisor.clj
index 6207137..d15a9d7 100644
--- a/storm-core/src/clj/org/apache/storm/daemon/supervisor.clj
+++ b/storm-core/src/clj/org/apache/storm/daemon/supervisor.clj
@@ -282,6 +282,11 @@
 
 (defn try-cleanup-worker [conf supervisor id]
   (try
+    ;; clean up for resource isolation if enabled
+    (if (conf STORM-RESOURCE-ISOLATION-PLUGIN-ENABLE)
+      (.releaseResourcesForWorker (:resource-isolation-manager supervisor) id))
+    ;; Always make sure to clean up everything else before worker directory
+    ;; is removed since that is what is going to trigger the retry for cleanup
     (if (.exists (File. (ConfigUtils/workerRoot conf id)))
       (do
         (if (conf SUPERVISOR-RUN-WORKER-AS-USER)
@@ -295,8 +300,6 @@
         (ConfigUtils/removeWorkerUserWSE conf id)
         (remove-dead-worker id)
       ))
-    (if (conf STORM-RESOURCE-ISOLATION-PLUGIN-ENABLE)
-      (.releaseResourcesForWorker (:resource-isolation-manager supervisor) id))
   (catch IOException e
     (log-warn-error e "Failed to cleanup worker " id ". Will retry later"))
   (catch RuntimeException e