You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@zookeeper.apache.org by "Zili Chen (Jira)" <ji...@apache.org> on 2019/10/14 11:48:00 UTC

[jira] [Commented] (ZOOKEEPER-3579) handle NPE gracefully when the watch parameter of zookeeper java client is null

    [ https://issues.apache.org/jira/browse/ZOOKEEPER-3579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16950948#comment-16950948 ] 

Zili Chen commented on ZOOKEEPER-3579:
--------------------------------------

Nice catch [~maoling]. I think it can be resolved by filtering out null default watcher in {{ClientWatchManager#materialize}}. Would you like to send a pull request to it?

> handle NPE gracefully when the watch parameter of zookeeper java client is null
> -------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-3579
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3579
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: java client
>            Reporter: maoling
>            Priority: Minor
>
> When we use the native java client
> {code:java}
> try {
>   zk = new ZooKeeper(connectString, (int) sessionTimeout, null);
> } catch (IOException e) {
>   throw new DBException("Creating connection failed.");
> }
> {code}
> We will get the following, this issue had existed in all the zookeeper releases for a long time
> {code:java}
> 2019-10-14 18:41:49 ERROR ClientCnxn:537 - Error while calling watcher2019-10-14 18:41:49 ERROR ClientCnxn:537 - Error while calling watcherjava.lang.NullPointerException at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:535) at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:510)2019-10-14 18:41:50 ERROR ClientCnxn:537 - Error while calling watcherjava.lang.NullPointerException at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:535) at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:510)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)