You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by gopikori <gi...@git.apache.org> on 2014/12/28 15:03:37 UTC

[GitHub] curator pull request: If zookeeper is down when discovery is start...

GitHub user gopikori opened a pull request:

    https://github.com/apache/curator/pull/58

    If zookeeper is down when discovery is started, it fails to register when the zookeeper comes up for the first time.

    **The issue:** 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, it discovery will connect and register the service instance correctly.
    **Cause :** This happened because *org.apache.curator.x.discovery.details.ServiceDiscoveryImpl.stateChanged()* considered only *ConnectionState.RECONNECTED* state and not *ConnectionState.CONNECTED*.  This caused the first connection to be ignored, while subsequent connection recoveries worked fine. 
    
    This pull request has fix for the same and a test case for it.

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

    $ git pull https://github.com/gopikori/curator CURATOR-175

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

    https://github.com/apache/curator/pull/58.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 #58
    
----
commit 4190147dbedb350ce1d42eb1ace86de0d0c9aef9
Author: gopi <go...@gmail.com>
Date:   2014-12-28T13:53:26Z

    If zookeeper is down when discovery is started, it fails to register
    when the zookeeper comes up for the first time. This commit has fix for
    this issue

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] curator pull request: CURATOR-175: If zookeeper is down when disco...

Posted by gopikori <gi...@git.apache.org>.
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 your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] curator pull request: CURATOR-175: If zookeeper is down when disco...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/curator/pull/58


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---