Return-Path: Delivered-To: apmail-hadoop-zookeeper-dev-archive@locus.apache.org Received: (qmail 7565 invoked from network); 30 Jun 2008 15:20:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Jun 2008 15:20:05 -0000 Received: (qmail 87257 invoked by uid 500); 30 Jun 2008 15:20:06 -0000 Delivered-To: apmail-hadoop-zookeeper-dev-archive@hadoop.apache.org Received: (qmail 87235 invoked by uid 500); 30 Jun 2008 15:20:06 -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 87224 invoked by uid 99); 30 Jun 2008 15:20:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jun 2008 08:20:06 -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; Mon, 30 Jun 2008 15:19:24 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id F2289234C14D for ; Mon, 30 Jun 2008 08:19:44 -0700 (PDT) Message-ID: <1578024673.1214839184990.JavaMail.jira@brutus> Date: Mon, 30 Jun 2008 08:19:44 -0700 (PDT) From: "Benjamin Reed (JIRA)" To: zookeeper-dev@hadoop.apache.org Subject: [jira] Commented: (ZOOKEEPER-58) Race condition on ClientCnxn.java In-Reply-To: <1523578928.1214581125214.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-58?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12609253#action_12609253 ] Benjamin Reed commented on ZOOKEEPER-58: ---------------------------------------- +1 Looks good > Race condition on ClientCnxn.java > --------------------------------- > > Key: ZOOKEEPER-58 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-58 > Project: Zookeeper > Issue Type: Bug > Components: java client > Reporter: Flavio Paiva Junqueira > Assignee: Flavio Paiva Junqueira > Attachments: patch-incoming-race.txt > > > There is a race condition involving the ByteByffer incomingBuffer, a field of ClientCnxn.SendThread. SendThread reads a packet in two steps: first it reads the length of the packet, followed by a read of the packet itself. Each of these steps corresponds to a call to doIO() from the main loop of run(). If there is an exception or the session times out, then it may leave incomingBuffer in an inconsistent state. > The attached patch adds code to reset incomingBuffer upon a call to SendThread.cleanup(). This method is called upon an exception on run(). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.