You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2022/04/08 05:34:49 UTC

[GitHub] [zookeeper] symat commented on pull request #1855: ZOOKEEPER-1875: NullPointerException in ClientCnxn$EventThread.processEvent

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: notifications-unsubscribe@zookeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org