You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by enixon <gi...@git.apache.org> on 2018/08/29 21:33:11 UTC

[GitHub] zookeeper issue #611: ZOOKEEPER-3131

Github user enixon commented on the issue:

    https://github.com/apache/zookeeper/pull/611
  
    I see. It depends on what you are optimizing. The Watcher will be removed from watch2Paths when the ServerCnxn for it is closed. Keeping a set in the map for it strikes me as an optimization based on the heuristic that clients that create one watch are likely to make others and that the empty state of their watches is a temporary one. This is vulnerable to creep if connections only make single watches during their lifetime and do not renew when they're fired. 
    
    My inclination is to keep the current behavior. Far more often, a client workload requires re-establishing a watch after it has fired and the temporarily empty state of its watch set will soon pass. Aggressively cleaning up the map just makes more work in recreating entries and allocating new HashSets.


---