zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tumativ <...@git.apache.org>
Subject [GitHub] zookeeper pull request #689: ZOOKEEPER-3183:Notifying the WatcherCleaner thr...
Date Wed, 07 Nov 2018 23:31:33 GMT
Github user tumativ commented on a diff in the pull request:

    --- Diff: zookeeper-server/src/main/java/org/apache/zookeeper/server/watch/WatcherCleaner.java
    @@ -50,6 +50,8 @@
         private volatile boolean stopped = false;
         private final Object cleanEvent = new Object();
    +    private final Object produserAndConsumerLock = new Object();
    --- End diff --
    The producer of the dead watcher is trying to get the lock on totalDeadWatchers when totalDeadWatchers
reaches the maximum. The expectation is the consumer needs to reduce this count .totalDeadWatchers
is AtomicInteger and getting a lock  on AtomicInteger is a not a good idea as it has their
own concurrency control mechanisms. It will basically confuse why the lock is required on
totalDeadWatchers at producer level when we are expecting consumer should reduce this count
and  it has their own concurrency control mechanisms


View raw message