[ https://issues.apache.org/jira/browse/ZOOKEEPER-442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13872964#comment-13872964 ]
Rakesh R commented on ZOOKEEPER-442: ------------------------------------ Thanks again [~phunt], [~rgs] for the great help. Sure, I'll once again go through the code closely and see the synchronizations/improvements(if any). bq.watchers.size() == 0 should suffice, if (as pointed out by Patrick) all our access around watchers is synchronized. We don't see to be enforcing that so we might have some races around that. Hi Raul, Are you pointing me to see the synchronization of the newly added code. The new logic included to fix the leak is already inside the synchronization block as shown below, so this part of the code is safer. {code} synchronized (existWatches) { + boolean removedDataWatcher = removeWatches(existWatches, + watcher, clientPath, local, rc, dataWatchersToRem); + removedWatcher |= removedDataWatcher; + } {code} > need a way to remove watches that are no longer of interest > ----------------------------------------------------------- > > Key: ZOOKEEPER-442 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-442 > Project: ZooKeeper > Issue Type: Sub-task > Components: java client, server > Reporter: Benjamin Reed > Assignee: Rakesh R > Priority: Critical > Fix For: 3.5.0 > > Attachments: Remove Watch API.pdf, ZOOKEEPER-442.patch, > ZOOKEEPER-442.patch, ZOOKEEPER-442.patch, ZOOKEEPER-442.patch, > ZOOKEEPER-442.patch, ZOOKEEPER-442.patch, ZOOKEEPER-442.patch, > ZOOKEEPER-442.patch, ZOOKEEPER-442.patch, ZOOKEEPER-442.patch, > ZOOKEEPER-442.patch, ZOOKEEPER-442.patch, ZOOKEEPER-442.patch, > ZOOKEEPER-442.patch > > > currently the only way a watch cleared is to trigger it. we need a way to > enumerate the outstanding watch objects, find watch events the objects are > watching for, and remove interests in an event. -- This message was sent by Atlassian JIRA (v6.1.5#6160)