Jacky007 created ZOOKEEPER-1561:
-----------------------------------
Summary: 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