You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by nkvoll <gi...@git.apache.org> on 2015/09/02 20:06:01 UTC

[GitHub] curator pull request: [CURATOR-258] PersistentEphemeralNode stops ...

GitHub user nkvoll opened a pull request:

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

    [CURATOR-258] PersistentEphemeralNode stops watching after first WatchedEvent

    See https://issues.apache.org/jira/browse/CURATOR-258

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

    $ git pull https://github.com/nkvoll/curator CURATOR-258

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

    https://github.com/apache/curator/pull/102.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 #102
    
----
commit cdb3a8035a551e3fb23e972a19cbeae47b14c27f
Author: Njal Karevoll <nj...@karevoll.no>
Date:   2015-09-02T18:03:28Z

    continue watching the node until it is deleted or the recipe is stopped

----


---
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-258] PersistentEphemeralNode stops ...

Posted by Randgalt <gi...@git.apache.org>.
Github user Randgalt commented on a diff in the pull request:

    https://github.com/apache/curator/pull/102#discussion_r39924798
  
    --- Diff: curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentEphemeralNode.java ---
    @@ -74,10 +74,18 @@
             @Override
             public void process(WatchedEvent event)
             {
    -        	if ( event.getType() == EventType.NodeDeleted)
    -        	{
    -        		createNode();
    -        	}
    +            if ( event.getType() == EventType.NodeDeleted)
    +            {
    +                createNode();
    +            }
    +            else if ( event.getType() == EventType.NodeDataChanged)
    +            {
    +                try {
    +                    watchNode();
    +                } catch (Exception e) {
    +                    log.error(String.format("Unexpected error during watching of path: %s", basePath), e);
    --- End diff --
    
    Maybe switch to a CuratorWatcher and let it handle the exception.


---
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-258] PersistentEphemeralNode stops ...

Posted by cammckenzie <gi...@git.apache.org>.
Github user cammckenzie commented on the pull request:

    https://github.com/apache/curator/pull/102#issuecomment-141631755
  
    Looks good to me, anyone else want to have a look? If not, I'll merge.


---
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-258] PersistentEphemeralNode stops ...

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

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


---
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.
---