Github user lvfangmin commented on a diff in the pull request:
https://github.com/apache/curator/pull/205#discussion_r127384661
--- Diff:
curator-framework/src/main/java/org/apache/curator/framework/imps/EnsembleTracker.java
---
@@ -166,12 +166,26 @@ public static String
configToConnectionString(QuorumVerifier data) throws Except
StringBuilder sb = new StringBuilder();
for ( QuorumPeer.QuorumServer server :
data.getAllMembers().values() )
{
+ if ( server.clientAddr == null )
+ {
+ // Invalid client address configuration in zoo.cfg
+ continue;
+ }
if ( sb.length() != 0 )
{
sb.append(",");
}
- InetSocketAddress address =
Objects.firstNonNull(server.clientAddr, server.addr);
-
sb.append(address.getAddress().getHostAddress()).append(":").append(address.getPort());
+ InetAddress wildcardAddress = new
InetSocketAddress(0).getAddress();
+ String hostAddress;
+ if ( wildcardAddress.equals(server.clientAddr.getAddress()) )
--- End diff --
If the clientAddr is in IPv6 format, will this equal? Or we should also
check the Inet6Address, would be great if you can add a test case with IPv6
wildcard.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---