You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by pt...@apache.org on 2017/08/30 21:07:47 UTC

[24/50] [abbrv] storm git commit: [STORM-2674] catch NoNodeException when IStormClusterState tries to delete znodes in reportError function

[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/metrics_v2
Commit: 93dc79557bc210b9239c6ae571c6103e5850b2ad
Parents: cd4f917
Author: Ethan Li <et...@gmail.com>
Authored: Mon Aug 7 08:27:49 2017 -0500
Committer: Ethan Li <et...@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;
+                }
+            }
         }
     }