[GitHub] storm pull request: STORM-1750: Ensure worker dies when report-err...

2016-05-05 Thread Jackyele
Github user Jackyele commented on a diff in the pull request:

https://github.com/apache/storm/pull/1384#discussion_r62157087
  
--- Diff: storm-core/src/jvm/org/apache/storm/cluster/ZKStateStorage.java 
---
@@ -189,7 +190,15 @@ public void set_data(String path, byte[] data, 
List acls) {
 Zookeeper.setData(zkWriter, path, data);
 } else {
 Zookeeper.mkdirs(zkWriter, Zookeeper.parentPath(path), acls);
-Zookeeper.createNode(zkWriter, path, data, 
CreateMode.PERSISTENT, acls);
+try {
+Zookeeper.createNode(zkWriter, path, data, 
CreateMode.PERSISTENT, acls);
+} catch (RuntimeException e) {
--- End diff --

yeah, we have to catch RuntimeError first; and how about using **Utils. 
exceptionCauseIsInstanceOf** instead for consistency, just like 
https://github.com/apache/storm/blob/master/storm-core/src/jvm/org/apache/storm/zookeeper/Zookeeper.java#L165
 does


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] storm pull request: STORM-1750: Ensure worker dies when report-err...

2016-05-05 Thread Jackyele
Github user Jackyele commented on a diff in the pull request:

https://github.com/apache/storm/pull/1384#discussion_r62154514
  
--- Diff: storm-core/src/jvm/org/apache/storm/cluster/ZKStateStorage.java 
---
@@ -189,7 +190,15 @@ public void set_data(String path, byte[] data, 
List acls) {
 Zookeeper.setData(zkWriter, path, data);
 } else {
 Zookeeper.mkdirs(zkWriter, Zookeeper.parentPath(path), acls);
-Zookeeper.createNode(zkWriter, path, data, 
CreateMode.PERSISTENT, acls);
+try {
+Zookeeper.createNode(zkWriter, path, data, 
CreateMode.PERSISTENT, acls);
+} catch (RuntimeException e) {
--- End diff --

Why not catch NodeExistsException directly


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---