Repository: storm Updated Branches: refs/heads/master 37205df2b -> fc03b85ed
[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/51df6acc Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/51df6acc Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/51df6acc Branch: refs/heads/master Commit: 51df6accfb58d7be94eed4e47226e04d4bba0db1 Parents: 6ae02e4 Author: Ethan Li <ethanopensou...@gmail.com> Authored: Wed Aug 2 13:52:41 2017 -0500 Committer: Ethan Li <ethanopensou...@gmail.com> Committed: Wed Aug 2 13:52:41 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/51df6acc/storm-client/src/jvm/org/apache/storm/cluster/StormClusterStateImpl.java ---------------------------------------------------------------------- diff --git a/storm-client/src/jvm/org/apache/storm/cluster/StormClusterStateImpl.java b/storm-client/src/jvm/org/apache/storm/cluster/StormClusterStateImpl.java index 1357584..50b5e7d 100644 --- a/storm-client/src/jvm/org/apache/storm/cluster/StormClusterStateImpl.java +++ b/storm-client/src/jvm/org/apache/storm/cluster/StormClusterStateImpl.java @@ -656,7 +656,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; + } + } } }