kaisun2000 commented on a change in pull request #1035:
URL: https://github.com/apache/helix/pull/1035#discussion_r434998838
##########
File path:
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java
##########
@@ -1849,13 +1924,23 @@ private void checkDataSizeLimit(byte[] data) {
}
public void watchForData(final String path) {
- retryUntilConnected(new Callable<Object>() {
- @Override
- public Object call() throws Exception {
- getConnection().exists(path, true);
- return null;
+ watchForData(path, false);
+ }
+
+ private boolean watchForData(final String path, boolean
skipWatchingNodeNotExist) {
+ try {
+ if (skipWatchingNodeNotExist) {
+ Stat stat = new Stat();
Review comment:
https://zookeeper.apache.org/doc/r3.3.3/api/org/apache/zookeeper/ZooKeeper.html#getData(java.lang.String,%20boolean,%20org.apache.zookeeper.data.Stat)
They did not say this is guaranteed for you to pass null. What you state may
be true for now, but not later. Or not earlier.
What is more, is there a way to check all the version of client having this
behavior?
Better to be defensive, seems to me. Saving such a constructor really means
much. The trouble it can potentially bring to us is tremendous though.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]