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

Why org.apache.zookeeper.ClientCnxnSocketNIO#cleanup will sleep 100ms.

Log workAgile BoardRank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsAdd voteVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Wish
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • None
    • None
    • java client
    • None

    Description

      Hi, I notice the code as follow:

      void cleanup() {
          if (sockKey != null) {
              SocketChannel sock = (SocketChannel) sockKey.channel();
              sockKey.cancel();
              try {
                  sock.socket().shutdownInput();
              } catch (IOException e) {
                  LOG.debug("Ignoring exception during shutdown input", e);
              }
              try {
                  sock.socket().shutdownOutput();
              } catch (IOException e) {
                  LOG.debug("Ignoring exception during shutdown output", e);
              }
              try {
                  sock.socket().close();
              } catch (IOException e) {
                  LOG.debug("Ignoring exception during socket close", e);
              }
              try {
                  sock.close();
              } catch (IOException e) {
                  LOG.debug("Ignoring exception during channel close", e);
              }
          }
          try {
              Thread.sleep(100);
          } catch (InterruptedException e) {
              LOG.debug("SendThread interrupted during sleep, ignoring");
          }
          sockKey = null;
      }

      I want to know why there sleep 100ms.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned Assign to me
            horizonzy Yan Zhao

            Dates

              Created:
              Updated:

              Slack

                Issue deployment