From c54162418a4a46d99ac360661f78cc5e10cb654a Mon Sep 17 00:00:00 2001 From: zhuol Date: Wed, 30 Mar 2016 17:21:41 -0500 Subject: [PATCH 1/2] [STORM-1667] Log the IO exception when deleting worker pid dir --- .../src/clj/org/apache/storm/daemon/supervisor.clj | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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 7be1421820a..ced8e7e05e3 100644 --- a/storm-core/src/clj/org/apache/storm/daemon/supervisor.clj +++ b/storm-core/src/clj/org/apache/storm/daemon/supervisor.clj @@ -269,10 +269,7 @@ (catch IOException e (log-warn-error e "Failed to cleanup worker " id ". Will retry later")) (catch RuntimeException e - (log-warn-error e "Failed to cleanup worker " id ". Will retry later") - ) - (catch java.io.FileNotFoundException e (log-message (.getMessage e))) - )) + (log-warn-error e "Failed to cleanup worker " id ". Will retry later")))) (defn shutdown-worker [supervisor id] (log-message "Shutting down " (:supervisor-id supervisor) ":" id) @@ -296,11 +293,15 @@ (worker-launcher-and-wait conf user ["signal" pid "9"] :log-prefix (str "kill -9 " pid)) (force-kill-process pid)) (if as-user - (rmr-as-user conf id (worker-pid-path conf id pid)) (try + (rmr-as-user conf id (worker-pid-path conf id pid)) (rmpath (worker-pid-path conf id pid)) (rmpath (worker-tmp-root conf id pid)) - (catch Exception e)))) ;; on windows, the supervisor may still holds the lock on the worker directory + (catch IOException e + (log-warn-error e "Failed to cleanup pid dir: " pid " for worker " id". Will retry later")) + (catch RuntimeException e + (log-warn-error e "Failed to cleanup pid dir: " pid " for worker " id". Will retry later"))))) + ;; on windows, the supervisor may still holds the lock on the worker directory (try-cleanup-worker conf id)) (log-message "Shut down " (:supervisor-id supervisor) ":" id)) From b3b934a777e6a2f1ec505e63336c12549cd949c1 Mon Sep 17 00:00:00 2001 From: zhuol Date: Thu, 31 Mar 2016 11:12:25 -0500 Subject: [PATCH 2/2] Back to ignore all exception --- storm-core/src/clj/org/apache/storm/daemon/supervisor.clj | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 ced8e7e05e3..b8242ca565e 100644 --- a/storm-core/src/clj/org/apache/storm/daemon/supervisor.clj +++ b/storm-core/src/clj/org/apache/storm/daemon/supervisor.clj @@ -297,9 +297,7 @@ (rmr-as-user conf id (worker-pid-path conf id pid)) (rmpath (worker-pid-path conf id pid)) (rmpath (worker-tmp-root conf id pid)) - (catch IOException e - (log-warn-error e "Failed to cleanup pid dir: " pid " for worker " id". Will retry later")) - (catch RuntimeException e + (catch Exception e (log-warn-error e "Failed to cleanup pid dir: " pid " for worker " id". Will retry later"))))) ;; on windows, the supervisor may still holds the lock on the worker directory (try-cleanup-worker conf id))