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:47:46 GMT
Github user anmolnar commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/451#discussion_r186591140
  
    --- Diff: src/java/main/org/apache/zookeeper/client/HostProvider.java ---
    @@ -53,7 +54,7 @@
          * @param spinDelay
          *            Milliseconds to wait if all hosts have been tried once.
          */
    -    public InetSocketAddress next(long spinDelay);
    +    public InetSocketAddress next(long spinDelay) throws UnknownHostException;
    --- End diff --
    
    That's a very good point actually, can't remember why implemented this way. 
    
    I checked the callers' side and both fall into the same try-catch report loop which reports
the problem and retry calling `next()` method. I think the reason was to keep the logic simple
here and don't implement something which is already handled by someone else.
    
    But because it's a change on a public API, it would be probably better to do the retry
logic here.


---

Mime
View raw message