From dev-return-78102-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Tue Feb 5 14:50:30 2019 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 A16CB18067A for ; Tue, 5 Feb 2019 15:50:29 +0100 (CET) Received: (qmail 41900 invoked by uid 500); 5 Feb 2019 14:50:28 -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 41889 invoked by uid 99); 5 Feb 2019 14:50:28 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Feb 2019 14:50:28 +0000 From: GitBox To: dev@zookeeper.apache.org Subject: [GitHub] anmolnar commented on a change in pull request #753: ZOOKEEPER-3204: Reconfig tests are constantly failing on 3.5 after applying Java 11 fix Message-ID: <154937822810.18790.14922805122198317333.gitbox@gitbox.apache.org> Date: Tue, 05 Feb 2019 14:50:28 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit anmolnar commented on a change in pull request #753: ZOOKEEPER-3204: Reconfig tests are constantly failing on 3.5 after applying Java 11 fix URL: https://github.com/apache/zookeeper/pull/753#discussion_r253894823 ########## File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/NettyServerCnxn.java ########## @@ -411,19 +494,44 @@ public void receiveMessage(ChannelBuffer message) { } } + /** + * An event that triggers a change in the channel's "Auto Read" setting. + * Used for throttling. By using an enum we can treat the two values as + * singletons and compare with ==. + */ + enum AutoReadEvent { + DISABLE, + ENABLE + } + @Override public void disableRecv() { - disableRecvNoWait().awaitUninterruptibly(); + if (throttled.compareAndSet(false, true)) { + if (LOG.isDebugEnabled()) { + LOG.debug("Throttling - disabling recv {}", this); + } + channel.pipeline().fireUserEventTriggered(AutoReadEvent.DISABLE); + } } - - private ChannelFuture disableRecvNoWait() { - throttled = true; - if (LOG.isDebugEnabled()) { - LOG.debug("Throttling - disabling recv " + this); + + /** + * Note that the netty implementation ignores the waitDisableRecv Review comment: Done. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services