Details
-
Sub-task
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
There have been several jira tickets to fix the close logic but there are still possibilities for blocks as discovered in ZOOKEEPER-911.
For example the failing server.InvalidSnapshotTest times out because the ClientCnxn.close() call blocks in Packet.waitForFinish().
However the only change introduced is that instead of
synchronize(packet) while(!packet.finished) packet.wait()
I call packet.waitForFinish() which is a synchronized method.
The bug is in ClientCnxn.queuePacket:
ClientCnxn.closing is set to true before the closeSession Packet is added to outgoingQueue. Between these two steps, the SendThread already terminate so that there's nobody left to call packet.notifyAll().