Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-1561

Zookeeper client may hang on a server restart

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 3.5.0
    • Fix Version/s: 3.5.0
    • Component/s: java client
    • Labels:
      None

      Description

      In the doIO method of ClientCnxnSocketNIO

       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);
                              }
                          }
      

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                fanster.z Jacky007
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: