Repository: storm
Updated Branches:
  refs/heads/1.x-branch 31dc9206d -> bedd68d93


[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/93dc7955
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/93dc7955
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/93dc7955

Branch: refs/heads/1.x-branch
Commit: 93dc79557bc210b9239c6ae571c6103e5850b2ad
Parents: cd4f917
Author: Ethan Li <ethanopensou...@gmail.com>
Authored: Mon Aug 7 08:27:49 2017 -0500
Committer: Ethan Li <ethanopensou...@gmail.com>
Committed: Mon Aug 7 08:27:49 2017 -0500

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


http://git-wip-us.apache.org/repos/asf/storm/blob/93dc7955/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