Return-Path: Delivered-To: apmail-hadoop-zookeeper-dev-archive@minotaur.apache.org Received: (qmail 88444 invoked from network); 8 Oct 2009 17:12:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Oct 2009 17:12:56 -0000 Received: (qmail 26861 invoked by uid 500); 8 Oct 2009 17:12:55 -0000 Delivered-To: apmail-hadoop-zookeeper-dev-archive@hadoop.apache.org Received: (qmail 26810 invoked by uid 500); 8 Oct 2009 17:12:55 -0000 Mailing-List: contact zookeeper-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: zookeeper-dev@hadoop.apache.org Delivered-To: mailing list zookeeper-dev@hadoop.apache.org Received: (qmail 26685 invoked by uid 99); 8 Oct 2009 17:12:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Oct 2009 17:12:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Oct 2009 17:12:52 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 53CA1234C1EF for ; Thu, 8 Oct 2009 10:12:31 -0700 (PDT) Message-ID: <2000470380.1255021951342.JavaMail.jira@brutus> Date: Thu, 8 Oct 2009 10:12:31 -0700 (PDT) From: "Patrick Hunt (JIRA)" To: zookeeper-dev@hadoop.apache.org Subject: [jira] Commented: (ZOOKEEPER-59) Synchronized block in NIOServerCnxn In-Reply-To: <206043174.1214824905020.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/ZOOKEEPER-59?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763567#action_12763567 ] Patrick Hunt commented on ZOOKEEPER-59: --------------------------------------- Hi Flavio, what's the status of this patch? > Synchronized block in NIOServerCnxn > ----------------------------------- > > Key: ZOOKEEPER-59 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-59 > Project: Zookeeper > Issue Type: Bug > Components: server > Reporter: Flavio Paiva Junqueira > Assignee: Flavio Paiva Junqueira > Fix For: 3.3.0 > > Attachments: ZOOKEEPER-59.patch > > > There are two synchronized blocks locking on different objects, and to me they should be guarded by the same object. Here are the parts of the code I'm talking about: > {noformat} > NIOServerCnxn.readRequest@444 > ... > synchronized (this) { > outstandingRequests++; > // check throttling > if (zk.getInProcess() > factory.outstandingLimit) { > disableRecv(); > // following lines should not be needed since we are already > // reading > // } else { > // enableRecv(); > } > } > {noformat} > {noformat} > NIOServerCnxn.sendResponse@740 > ... > synchronized (this.factory) { > outstandingRequests--; > // check throttling > if (zk.getInProcess() < factory.outstandingLimit > || outstandingRequests < 1) { > sk.selector().wakeup(); > enableRecv(); > } > } > {noformat} > I think the second one is correct, and the first synchronized block should be guarded by "this.factory". > This could be related to issue ZOOKEEPER-57, but I have no concrete indication that this is the case so far. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.