storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ptgo...@apache.org
Subject [3/7] storm git commit: STORM-682: supervisor should handle worker state corruption gracefully.
Date Wed, 18 Mar 2015 15:28:31 GMT
STORM-682: supervisor should handle worker state corruption gracefully.

Signed-off-by: P. Taylor Goetz <ptgoetz@gmail.com>


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

Branch: refs/heads/0.9.3-branch
Commit: c19e482b70f18d690ad165c78551860506486095
Parents: 92836de
Author: Parth Brahmbhatt <brahmbhatt.parth@gmail.com>
Authored: Fri Feb 20 11:56:22 2015 -0800
Committer: P. Taylor Goetz <ptgoetz@gmail.com>
Committed: Wed Mar 18 11:04:13 2015 -0400

----------------------------------------------------------------------
 storm-core/src/clj/backtype/storm/daemon/supervisor.clj     | 7 +++++--
 storm-core/src/jvm/backtype/storm/utils/VersionedStore.java | 9 +++++----
 2 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/c19e482b/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/supervisor.clj b/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
index 582c3df..f5eaf42 100644
--- a/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
+++ b/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
@@ -93,8 +93,11 @@
 
 (defn read-worker-heartbeat [conf id]
   (let [local-state (worker-state conf id)]
-    (.get local-state LS-WORKER-HEARTBEAT)
-    ))
+    (try
+      (.get local-state LS-WORKER-HEARTBEAT)
+      (catch IOException e
+        (log-warn e "Failed to read local heartbeat for workerId : " id ",Ignoring exception.")
+        nil))))
 
 
 (defn my-worker-ids [conf]

http://git-wip-us.apache.org/repos/asf/storm/blob/c19e482b/storm-core/src/jvm/backtype/storm/utils/VersionedStore.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/utils/VersionedStore.java b/storm-core/src/jvm/backtype/storm/utils/VersionedStore.java
index b40aa60..07ce5a8 100644
--- a/storm-core/src/jvm/backtype/storm/utils/VersionedStore.java
+++ b/storm-core/src/jvm/backtype/storm/utils/VersionedStore.java
@@ -94,13 +94,14 @@ public class VersionedStore {
     public void deleteVersion(long version) throws IOException {
         File versionFile = new File(versionPath(version));
         File tokenFile = new File(tokenPath(version));
-        
+
+        if(tokenFile.exists()) {
+            FileUtils.forceDelete(tokenFile);
+        }
+
         if(versionFile.exists()) {
             FileUtils.forceDelete(versionFile);
         }
-        if(tokenFile.exists()) {
-            FileUtils.forceDelete(tokenFile);
-        }        
     }
 
     public void succeedVersion(String path) throws IOException {


Mime
View raw message