Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.5.3, 3.5.4, 3.6.0
-
-Xmx512m
Description
In some cases, the variable watch2Paths in Class WatchManager does not remove the entry, even if the associated value "HashSet" is empty already.
The type of key in Map watch2Paths is Watcher, instance of NettyServerCnxn. If it is not removed when the associated set of paths is empty, it will cause the memory increases little by little, and OutOfMemoryError triggered finally.
Possible Solution:
In the following function, the logic should be added to remove the entry.
org.apache.zookeeper.server.WatchManager#removeWatcher(java.lang.String, org.apache.zookeeper.Watcher)
if (paths.isEmpty())
{ watch2Paths.remove(watcher); }For the following function as well:
org.apache.zookeeper.server.WatchManager#triggerWatch(java.lang.String, org.apache.zookeeper.Watcher.Event.EventType, java.util.Set<org.apache.zookeeper.Watcher>)
Please confirm this issue?
Attachments
Issue Links
- supercedes
-
ZOOKEEPER-2358 NettyServerCnxn leaks watches upon close
- Resolved
-
ZOOKEEPER-2509 Secure mode leaks memory
- Resolved
-
ZOOKEEPER-2527 Connection watch is not getting cleared when watch is created as part of get and it is fired as part of set and client is closed
- Resolved
-
ZOOKEEPER-2530 When zookeeper started in SSL mode, set a "get" watcher on a znode from zkCli client, restart the zkCli, the "Data" watcher still present. Trying removing that watcher fails saying no watcher available
- Resolved
- links to