zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmillar <...@git.apache.org>
Subject [GitHub] zookeeper pull request #430: ZOOKEEPER-2893. very poor choice of logging if ...
Date Wed, 13 Dec 2017 08:52:21 GMT
Github user paulmillar commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/430#discussion_r156594153
  
    --- Diff: src/java/main/org/apache/zookeeper/ClientCnxn.java ---
    @@ -1232,11 +1233,12 @@ public void run() {
                             } else if (e instanceof RWServerFoundException) {
                                 LOG.info(e.getMessage());
                             } else {
    +                            SocketAddress remoteAddr = clientCnxnSocket.getRemoteSocketAddress();
                                 LOG.warn(
                                         "Session 0x"
                                                 + Long.toHexString(getSessionId())
                                                 + " for server "
    -                                            + clientCnxnSocket.getRemoteSocketAddress()
    +                                            + (remoteAddr == null ? addr : remoteAddr)
    --- End diff --
    
    I believe that, if `clientCnxnSocket.getRemoteSocketAddress()` is non-null, the value
is always the same as `addr`.
    
    If so, then this could be simplified to just `addr` without the ternary operation.


---

Mime
View raw message