satishd commented on a change in pull request #9902: URL: https://github.com/apache/kafka/pull/9902#discussion_r566015590
########## File path: clients/src/main/java/org/apache/kafka/clients/ClusterConnectionStates.java ########## @@ -183,6 +186,10 @@ public void disconnected(String id, long now) { connectingNodes.remove(id); } else { resetConnectionSetupTimeout(nodeState); + if (nodeState.state.isConnected()) { + // If a connection had previously been established, re-resolve DNS because the IPs may have changed + nodeState.addresses = Collections.emptyList(); Review comment: @mimaison Java allows outer classes to access inner member's private members. This is described in detail at [JLS-6.6.1](https://docs.oracle.com/javase/specs/jls/se7/html/jls-6.html#jls-6.6.1) > A member (class, interface, field, or method) of a reference (class, interface, or array) type or a constructor of a class type is accessible only if the type is accessible and the member or constructor is declared to permit access: > - if the member or constructor is declared private, then access is permitted if and only if it occurs within the body of the top level class (ยง7.6) that encloses the declaration of the member or constructor. ########## File path: clients/src/main/java/org/apache/kafka/clients/ClusterConnectionStates.java ########## @@ -183,6 +186,10 @@ public void disconnected(String id, long now) { connectingNodes.remove(id); } else { resetConnectionSetupTimeout(nodeState); + if (nodeState.state.isConnected()) { + // If a connection had previously been established, re-resolve DNS because the IPs may have changed + nodeState.addresses = Collections.emptyList(); Review comment: Agree with @mimaison on the comment, good to make it clear by mentioning that the addresses are cleared to re-resolve later when it reconnects. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org