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

org.apache.zookeeper.server.NettyServerCnxn does not increase outstandingCount properly, cause outstandingCount to overflow.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 3.5.9
    • 3.6.0
    • None
    • None
    • It just a count.

    Description

      In the receiveMessage method the count is increased right after processPacket without judges anything as below.

      if (initialized) {
      // TODO: if zks.processPacket() is changed to take a ByteBuffer[],
      // we could implement zero-copy queueing.
      zks.processPacket(this, bb);

      if (zks.shouldThrottle(outstandingCount.incrementAndGet()))

      Unknown macro: { disableRecvNoWait(); }

      }

      But after the request is handled, the decrease operation is taken only when xid is larger than 0.

      @Override
      public void sendResponse(ReplyHeader h, Record r, String tag)
      throws IOException
      Unknown macro: { if (closingChannel || !channel.isOpen()) Unknown macro}
      super.sendResponse(h, r, tag);
      if (h.getXid() > 0)
      Unknown macro: { // zks cannot be null otherwise we would not have gotten here! if (!zkServer.shouldThrottle(outstandingCount.decrementAndGet())) Unknown macro}
      }
      }

       

      So the bultin xids like "PING", "AUTH", will make outstandingCount larger and larger, until it hits the limit; All the request on that connection will be refused.

       

      I see the problem is solved in 3.6.0 version, should there be a patch for 3.5.9? Looking forward for your reply, Thantks!

      Attachments

        Activity

          People

            Unassigned Unassigned
            linmaolin linmaolin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: