[
https://issues.apache.org/jira/browse/CURATOR-570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17125021#comment-17125021
]
Rhys Yarranton commented on CURATOR-570:
----------------------------------------
In zk 3.5.5, the value coming fr/ the zk server could be either hostname or IP
address. (I suspect based on what flavour went into the zk server config.)
On the zk client side, this gets turned into socket address in QuorumPeer(long,
String) using new InetSocketAddress(String, int). This will attempt to resolve
the address, and so could have both. (This is interesting, as in some other
places zk uses InetSocketAddress.createUnresolved, and createUnresolved would
seem appropriate here.)
Then it gets to EnsembleTracker.configToConnectionString (this is Curator code
now), which creates a String. The address part is taken as:
{code:java}
hostAddress = server.clientAddr.getAddress().getHostAddress();
{code}
which will be the IP address. Or if the address failed to resolve, it could
throw an NPE.
> Excessive calls to ZooKeeper.updateServerList (which can result in session
> death)
> ---------------------------------------------------------------------------------
>
> Key: CURATOR-570
> URL: https://issues.apache.org/jira/browse/CURATOR-570
> Project: Apache Curator
> Issue Type: Bug
> Components: Framework
> Affects Versions: 4.2.0, 4.3.0
> Reporter: Rhys Yarranton
> Priority: Major
>
> On suspend and reconnect, Curator calls ZooKeeper.updateServerList via
> ConnectionState.checkState --> ConnectionState.handleNewConnectionString. In
> addition, recipes may be triggered by this as well, and they too make calls
> ZooKeeper.updateServerList via ConnectState.checkTimeouts -->
> ConnectionState.handleNewConnectionString.
> This happens even though the connection string has not actually changed.
> Due to ZOOKEEPER-3825, this can cause the connection to be closed
> immediately. On its own this would be perceived as a glitch. But due to the
> Curator-induced calls, what we see is a cycle of SUSPENDED/RECONNECTED, until
> eventually the session dies and a new session is recreated.
> Based on the source code (at time of writing), ZooKeeper.updateServerList is
> not intended to be called frequently like this.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)