[
https://issues.apache.org/jira/browse/CURATOR-175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14260153#comment-14260153
]
ASF GitHub Bot commented on CURATOR-175:
----------------------------------------
Github user gopikori commented on the pull request:
https://github.com/apache/curator/pull/58#issuecomment-68265604
Not really. Because this was not a problem when the listener only
considered the *RECONNECTED* state. Before the fix, although the listener was
being registered earlier, the call to *reRegisterServices()* was prevented as
the *if* condition ignored *CONNECTED* state. But now with the *RECONNECTED*
state added to the *if* condition, this sequence change becomes necessary.
Reverting any of the two changes causes multiple test cases failure. I hope I
am clear.
> If zookeeper is down when discovery is started, it fails to register when the
> zookeeper comes up for the first time.
> --------------------------------------------------------------------------------------------------------------------
>
> Key: CURATOR-175
> URL: https://issues.apache.org/jira/browse/CURATOR-175
> Project: Apache Curator
> Issue Type: Bug
> Components: Framework
> Affects Versions: 2.7.0
> Reporter: Gopi Kori
> Priority: Minor
> Labels: curator-x-discovery
>
> If zookeeper is down when discovery is started, it fails to register when the
> zookeeper comes up for the first time.
> However, if the zookeeper is restarted again, discovery will connect and
> register the service instance correctly.
> This happens because
> org.apache.curator.x.discovery.details.ServiceDiscoveryImpl.stateChanged()
> considers only ConnectionState.RECONNECTED state and not
> ConnectionState.CONNECTED. This causes the first connection to be ignored,
> while subsequent connection recoveries work fine.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)