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

Raul Gutierrez Segales commented on ZOOKEEPER-1910:
---------------------------------------------------

Yeah I was thinking about this same thing while implementing RemoveWatches 
support in Kazoo (see 0 below). My, unpolished, thought is that the current 
removeWatches() API for the Java impl conflates two distinct actions:

a) removing the watch set on the Server
b) unregister a given watcher or set of watchers

Since 3.5.0 isn't out yet, are we still on time for changing our API? If so, 
how would you feel about having removeWatches *only* deal with the server-side 
part (i.e.: unregistering the watch from the data tree) and having something 
like unregisterWatcher() deal with the watchers known by the client?

So presumably you would have to remove your watch and unregister your watchers 
in separate steps. More calls, but better defined contracts. And, on top of 
this, you could always build convenience wrappers. Surely it means expanding 
the surface of our public API, but I think it might save us from confusing bugs 
given that as things are now we have weird corner cases.

Thoughts?

0) https://github.com/python-zk/kazoo/pull/189

> RemoveWatches wrongly removes the watcher if multiple watches exists on a path
> ------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1910
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1910
>             Project: ZooKeeper
>          Issue Type: Bug
>            Reporter: Rakesh R
>            Assignee: Rakesh R
>             Fix For: 3.5.0
>
>         Attachments: ZOOKEEPER-1910.patch
>
>
> Consider a case where zkclient has added 2 data watchers(say 'w1' and 'w2') 
> on '/node1'.
> Now user has removed w1, but this is deleting the 'CnxnWatcher' in ZK server 
> against the "/node1" path. This will affect other data watchers(if any) of 
> same client on same path. In our case 'w2' would not be notified.
> Note: please see the attached test case to understand more.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to