You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Eugene Koontz (JIRA)" <ji...@apache.org> on 2012/11/03 23:37:13 UTC

[jira] [Commented] (ZOOKEEPER-1561) Zookeeper client may hang on a server restart

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

Eugene Koontz commented on ZOOKEEPER-1561:
------------------------------------------

It's a good time to revisit this now that ZOOKEEPER-1560 is fixed. 
                
> Zookeeper client may hang on a server restart
> ---------------------------------------------
>
>                 Key: ZOOKEEPER-1561
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1561
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: java client
>    Affects Versions: 3.5.0
>            Reporter: Jacky007
>             Fix For: 3.5.0
>
>
> In the doIO method of ClientCnxnSocketNIO
> {noformat}
>  if (p != null) {
>                     outgoingQueue.removeFirstOccurrence(p);
>                     updateLastSend();
>                     if ((p.requestHeader != null) &&
>                             (p.requestHeader.getType() != OpCode.ping) &&
>                             (p.requestHeader.getType() != OpCode.auth)) {
>                         p.requestHeader.setXid(cnxn.getXid());
>                     }
>                     p.createBB();
>                     ByteBuffer pbb = p.bb;
>                     sock.write(pbb);
>                     if (!pbb.hasRemaining()) {
>                         sentCount++;
>                         if (p.requestHeader != null
>                                 && p.requestHeader.getType() != OpCode.ping
>                                 && p.requestHeader.getType() != OpCode.auth) {
>                             pending.add(p);
>                         }
>                     }
> {noformat}
> When the sock.write(pbb) method throws an exception, the packet will not be cleanup(not in outgoingQueue nor in pendingQueue). If the client wait for it, it will wait forever...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira