zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Reed (JIRA)" <j...@apache.org>
Subject [jira] Commented: (ZOOKEEPER-58) Race condition on ClientCnxn.java
Date Fri, 27 Jun 2008 16:08:45 GMT

    [ https://issues.apache.org/jira/browse/ZOOKEEPER-58?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12608819#action_12608819
] 

Benjamin Reed commented on ZOOKEEPER-58:
----------------------------------------

Excellent catch! I think it is better to do this in either primeConnection or startConnect,
that way we make sure everything is setup correctly at the start rather than trying to make
sure that we clean up correctly. Of the two my preference would probably be startConnect.

> 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
>         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.


Mime
View raw message