zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anmolnar <...@git.apache.org>
Subject [GitHub] zookeeper pull request #451: ZOOKEEPER-2184: Zookeeper Client should re-reso...
Date Tue, 08 May 2018 00:51:15 GMT
Github user anmolnar commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/451#discussion_r186591545
  
    --- Diff: src/java/main/org/apache/zookeeper/client/StaticHostProvider.java ---
    @@ -111,9 +154,18 @@ public InetSocketAddress next(long spinDelay) {
                 lastIndex = 0;
             }
     
    -        return serverAddresses.get(currentIndex);
    +        InetSocketAddress curAddr = serverAddresses.get(currentIndex);
    +
    +        String curHostString = getHostString(curAddr);
    +        List<InetAddress> resolvedAddresses = new ArrayList<InetAddress>(Arrays.asList(this.resolver.getAllByName(curHostString)));
    +        if (resolvedAddresses.isEmpty()) {
    +            throw new UnknownHostException("No IP address returned for address: " + curHostString);
    --- End diff --
    
    I believe the expectation - and the original behaviour- is to loop forever until the DNS
problem is fixed. Even if we don't do it here, the caller will.
    
    I'd loop here infinitely. Also should keep an eye on spinDelays to avoid hammering the
logic.


---

Mime
View raw message