storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srihar...@apache.org
Subject [1/3] storm git commit: STORM-682: supervisor should handle worker state corruption gracefully.
Date Thu, 12 Mar 2015 23:02:59 GMT
Repository: storm
Updated Branches:
  refs/heads/master 117256b60 -> 73a7f5d73


STORM-682: supervisor should handle worker state corruption gracefully.


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

Branch: refs/heads/master
Commit: ca7bd99beff75e592c6abc9ba5186633d00f0fe4
Parents: a8eab50
Author: Parth Brahmbhatt <brahmbhatt.parth@gmail.com>
Authored: Fri Feb 20 11:56:22 2015 -0800
Committer: Parth Brahmbhatt <brahmbhatt.parth@gmail.com>
Committed: Mon Feb 23 10:08:25 2015 -0800

----------------------------------------------------------------------
 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/ca7bd99b/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 a5d5aef..a040f06 100644
--- a/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
+++ b/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
@@ -97,8 +97,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/ca7bd99b/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