zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From enixon <...@git.apache.org>
Subject [GitHub] zookeeper issue #611: ZOOKEEPER-3131
Date Wed, 29 Aug 2018 21:33:11 GMT
Github user enixon commented on the issue:

    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.


View raw message