From dev-return-75950-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Mon Nov 19 06:03:34 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id B7CFD18066C for ; Mon, 19 Nov 2018 06:03:33 +0100 (CET) Received: (qmail 36057 invoked by uid 500); 19 Nov 2018 05:03:32 -0000 Mailing-List: contact dev-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list dev@zookeeper.apache.org Received: (qmail 36003 invoked by uid 99); 19 Nov 2018 05:03:31 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Nov 2018 05:03:31 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6EA58E0A43; Mon, 19 Nov 2018 05:03:31 +0000 (UTC) From: lvfangmin To: dev@zookeeper.apache.org Reply-To: dev@zookeeper.apache.org References: In-Reply-To: Subject: [GitHub] zookeeper pull request #689: ZOOKEEPER-3183:Notifying the WatcherCleaner thr... Content-Type: text/plain Message-Id: <20181119050331.6EA58E0A43@git1-us-west.apache.org> Date: Mon, 19 Nov 2018 05:03:31 +0000 (UTC) Github user lvfangmin commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/689#discussion_r234494972 --- Diff: zookeeper-server/src/main/java/org/apache/zookeeper/server/watch/WatcherCleaner.java --- @@ -102,24 +104,24 @@ public void addDeadWatcher(int watcherBit) { totalDeadWatchers.get() >= maxInProcessingDeadWatchers) { try { RATE_LOGGER.rateLimitLog("Waiting for dead watchers cleaning"); - synchronized(totalDeadWatchers) { - totalDeadWatchers.wait(100); - } - } catch (InterruptedException e) { - LOG.info("Got interrupted while waiting for dead watches " + - "queue size"); - } - } - synchronized (this) { - if (deadWatchers.add(watcherBit)) { - totalDeadWatchers.incrementAndGet(); - if (deadWatchers.size() >= watcherCleanThreshold) { - synchronized (cleanEvent) { - cleanEvent.notifyAll(); - } - } - } + synchronized (processingCompletedEvent) { --- End diff -- @tumativ looks like we still have some indent problem for this patch, can you help correct those? ---