[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14616025#comment-14616025
 ] 

ASF GitHub Bot commented on ZOOKEEPER-1846:
-------------------------------------------

GitHub user yongtang opened a pull request:

    https://github.com/apache/zookeeper/pull/37

    ZOOKEEPER-1846: Always recreate socket addresses for any DNS change.

    This pull is also related to ZOOKEEPER-1506. The fix allows DNS changes to 
be applied when ZooKeeper is running. ZOOKEEPER-1506 partially solves this 
issue, which has already been
    applied to ZooKeeper 3.5.1 (RC3). This pull request allows ZOOKEEPER-1846 
to be fixed as well.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/yongtang/zookeeper branch-3.5

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zookeeper/pull/37.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #37
    
----
commit 92a55a764f54521d3cd745a26f2fedfa7b5804ac
Author: yongtang <yongt...@users.noreply.github.com>
Date:   2015-07-07T01:15:50Z

    ZOOKEEPER-1846: Always recreate socket addresses for any DNS change. This 
fix is also related to ZOOKEEPER-1506.

----


> Cached InetSocketAddresses prevent proper dynamic DNS resolution
> ----------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1846
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1846
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: quorum
>    Affects Versions: 3.4.6
>            Reporter: Benjamin Jaton
>            Priority: Minor
>              Labels: patch
>         Attachments: DynamicIP.java.patch, Learner.java, 
> QuorumCnxManager.java, QuorumPeer.java
>
>
> The class QuorumPeer maintains a Map<Long, QuorumServer> quorumPeers.
> Each QuorumServer is created with an instance of InetSocketAddress 
> electionAddr, and holds it forever.
> I believe this is why the ZooKeeper servers can't resolve each other 
> dynamically: If a ZooKeeper in the ensemble cannot be resolved at startup, it 
> will never be resolved (until restart of the JVM), constantly failing with an 
> UnknownHostException, even when the node is back up and reachable.
> I would suggest to recreate an InetSocketAddress every time we retry the 
> connection.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to