Browse Source

ZOOKEEPER-4791: Improve logging when the connection to a remote serve… (#2114)

Maximilian Wittich 1 year ago
parent
commit
3913303677

+ 2 - 2
zookeeper-server/src/main/java/org/apache/zookeeper/server/NettyServerCnxn.java

@@ -527,8 +527,8 @@ public class NettyServerCnxn extends ServerCnxn {
                         }
                         ZooKeeperServer zks = this.zkServer;
                         if (zks == null || !zks.isRunning()) {
-                            LOG.info("Closing connection to {} because the server is not ready",
-                                    getRemoteSocketAddress());
+                            LOG.info("Closing connection to {} because the server is not ready (server state is: {})",
+                                getRemoteSocketAddress(), zks == null ? "unknown" : zks.getState());
                             close(DisconnectReason.IO_EXCEPTION);
                             return;
                         }