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

Improve logging when the connection to a remote server is closed

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 3.9.1
    • 3.10.0
    • server

    Description

      When a server closes the connection to a remote server, the logging around why the connection is being closed could be improved a bit.

      https://github.com/apache/zookeeper/blob/1cc1eb6a2be7323a5c326652d59a070473bb8779/zookeeper-server/src/main/java/org/apache/zookeeper/server/NettyServerCnxn.java#L524

      ZooKeeperServer zks = this.zkServer;
      if (zks == null || !zks.isRunning()) {
                                  LOG.info("Closing connection to {} because the server is not ready",
                                          getRemoteSocketAddress());
                                  close(DisconnectReason.IO_EXCEPTION);
                                  return;
                              }
      

      It would be helpful to log what zkServer is, because it can have multiple states that would trigger this shutdown.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sliebau Sönke Liebau
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m