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

Zookeeper client may hang on a server restart

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 3.5.0
    • 3.5.0
    • java client
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: