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 2014/06/25 16:02:58 UTC

[2/6] git commit: STORM-183: Replacing RunTime.halt() with RunTime.exit() with a special shutdown hook that allows 1 second for cleanup shutdown hooks and then sends kill -9 to process. Added shutdown hooks for supervisor and worker.

STORM-183: Replacing RunTime.halt() with RunTime.exit() with a special shutdown hook that allows 1 second for cleanup shutdown hooks and then sends kill -9 to process. Added shutdown hooks for supervisor and worker.


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

Branch: refs/heads/master
Commit: de8855d1dd6fbbfe431c33d49013a19881548732
Parents: 2c2570f
Author: Parth Brahmbhatt <br...@gmail.com>
Authored: Mon Jun 16 14:06:05 2014 -0700
Committer: Parth Brahmbhatt <br...@gmail.com>
Committed: Mon Jun 16 15:21:04 2014 -0700

----------------------------------------------------------------------
 storm-core/src/clj/backtype/storm/util.clj | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/de8855d1/storm-core/src/clj/backtype/storm/util.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/util.clj b/storm-core/src/clj/backtype/storm/util.clj
index db2db4a..4ca2951 100644
--- a/storm-core/src/clj/backtype/storm/util.clj
+++ b/storm-core/src/clj/backtype/storm/util.clj
@@ -430,9 +430,10 @@
    Also adds a function that sleeps for a second and then sends kill -9 to process to avoid any zombie process in case
    cleanup function hangs."
   [func]
-  (.addShutdownHook (Runtime/getRuntime) (Thread. #((func)
-                                                     (sleep-secs 1)
-                                                     (force-kill-process (process-pid))))))
+  (.addShutdownHook (Runtime/getRuntime) (Thread. #(func)))
+  (.addShutdownHook (Runtime/getRuntime) (Thread. #((sleep-secs 1)
+                                                    (.halt (Runtime/getRuntime) 20)))))
+
 (defnk launch-process [command :environment {}]
   (let [builder (ProcessBuilder. command)
         process-env (.environment builder)]