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

[jira] [Commented] (ZOOKEEPER-3992) addWatch api should check the null watch

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

Matteo Minardi commented on ZOOKEEPER-3992:
-------------------------------------------

Hey, I was looking for a good candidate for my first Zookeeper issue.
Can I pick this up? [~maoling]

> addWatch api should check the null watch
> ----------------------------------------
>
>                 Key: ZOOKEEPER-3992
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3992
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: java client
>            Reporter: maoling
>            Priority: Minor
>             Fix For: 3.7.0
>
>
> {code:java}
> public void addWatch(String basePath, Watcher watcher, AddWatchMode mode)
>         throws KeeperException, InterruptedException {
>     PathUtils.validatePath(basePath);
>     String serverPath = prependChroot(basePath);
>     RequestHeader h = new RequestHeader();
>     h.setType(ZooDefs.OpCode.addWatch);
>     AddWatchRequest request = new AddWatchRequest(serverPath, mode.getMode());
>     ReplyHeader r = cnxn.submitRequest(h, request, new ErrorResponse(),
>     
> {code}
> we need to _*validateWatcher(watcher)*_ to ** avoid the case:
> {code:java}
> zk.addWatch("/a/b", null, PERSISTENT_RECURSIVE);
> {code}



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