Return-Path: Delivered-To: apmail-hadoop-zookeeper-dev-archive@locus.apache.org Received: (qmail 73487 invoked from network); 6 Jul 2008 12:47:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Jul 2008 12:47:02 -0000 Received: (qmail 17233 invoked by uid 500); 6 Jul 2008 12:47:03 -0000 Delivered-To: apmail-hadoop-zookeeper-dev-archive@hadoop.apache.org Received: (qmail 17206 invoked by uid 500); 6 Jul 2008 12:47:03 -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 17195 invoked by uid 99); 6 Jul 2008 12:47:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Jul 2008 05:47:03 -0700 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; Sun, 06 Jul 2008 12:46:20 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 29542234C152 for ; Sun, 6 Jul 2008 05:46:36 -0700 (PDT) Message-ID: <1952446060.1215348396167.JavaMail.jira@brutus> Date: Sun, 6 Jul 2008 05:46:36 -0700 (PDT) From: "Flavio Paiva Junqueira (JIRA)" To: zookeeper-dev@hadoop.apache.org Subject: [jira] Assigned: (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-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/ZOOKEEPER-59?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Flavio Paiva Junqueira reassigned ZOOKEEPER-59: ----------------------------------------------- Assignee: Flavio Paiva Junqueira > 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 > > 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.