Repository: storm
Updated Branches:
  refs/heads/1.0.x-branch 8b724f3f1 -> 92b41722f


[STORM-2674] catch NoNodeException when IStormClusterState tries to delete 
znodes in reportError function


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

Branch: refs/heads/1.0.x-branch
Commit: a14a01df4ade881ad5869b16466972c464f3a634
Parents: 8b724f3
Author: Ethan Li <ethanopensou...@gmail.com>
Authored: Mon Aug 7 08:27:49 2017 -0500
Committer: Jungtaek Lim <kabh...@gmail.com>
Committed: Wed Aug 9 21:07:13 2017 +0900

----------------------------------------------------------------------
 .../org/apache/storm/cluster/StormClusterStateImpl.java | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/a14a01df/storm-core/src/jvm/org/apache/storm/cluster/StormClusterStateImpl.java
----------------------------------------------------------------------
diff --git 
a/storm-core/src/jvm/org/apache/storm/cluster/StormClusterStateImpl.java 
b/storm-core/src/jvm/org/apache/storm/cluster/StormClusterStateImpl.java
index 7f834fb..f9952cf 100644
--- a/storm-core/src/jvm/org/apache/storm/cluster/StormClusterStateImpl.java
+++ b/storm-core/src/jvm/org/apache/storm/cluster/StormClusterStateImpl.java
@@ -659,7 +659,17 @@ public class StormClusterStateImpl implements 
IStormClusterState {
         });
 
         while (childrens.size() > 10) {
-            stateStorage.delete_node(path + ClusterUtils.ZK_SEPERATOR + 
childrens.remove(0));
+            String znodePath = path + ClusterUtils.ZK_SEPERATOR + 
childrens.remove(0);
+            try {
+                stateStorage.delete_node(znodePath);
+            } catch (Exception e) {
+                if 
(Utils.exceptionCauseIsInstanceOf(KeeperException.NoNodeException.class, e)) {
+                    // if the node is already deleted, do nothing
+                    LOG.warn("Could not find the znode: {}", znodePath);
+                } else {
+                    throw e;
+                }
+            }
         }
     }
 

Reply via email to