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

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

     [ https://issues.apache.org/jira/browse/ZOOKEEPER-3992?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Damien Diederen resolved ZOOKEEPER-3992.
----------------------------------------
    Resolution: Fixed

Issue resolved by pull request 1529
[https://github.com/apache/zookeeper/pull/1529]

> 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
>            Assignee: Damien Diederen
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 3.7.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> {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)