symat commented on PR #1855:
URL: https://github.com/apache/zookeeper/pull/1855#issuecomment-1092458477
AFAIK your watcher should never be null. (Without a watcher you don't know
if you are even connected to ZK or not... the successful connection and also
the disconnection events reach the ZK client user through the watcher.)
Previously we were throwing exception in this watcher==null case, and this was
not not too bad, as most likely this is not how the caller app wanted to start
the ZooKeeper client in the first place. Although NPE might not the right
exception to throw :)
So my point here is: Isn't this change breaking compatibility? Shouldn't we
throw at least some InvalidStateException after logging?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]