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

Jacky007 commented on ZOOKEEPER-1561:
-------------------------------------

It was fixed in ZOOKEEPER-1560.
                
> 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

Reply via email to