You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Tom Byrne (JIRA)" <ji...@apache.org> on 2015/06/24 22:05:05 UTC
[jira] [Commented] (ZOOKEEPER-2217) event might lost before
re-watch
[ https://issues.apache.org/jira/browse/ZOOKEEPER-2217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14600054#comment-14600054 ]
Tom Byrne commented on ZOOKEEPER-2217:
--------------------------------------
Doesn't Zookeeper.getChildren(final String path, Watcher watcher) do what you want? It re-sets a watch on the path when getting the children, and you never miss events.
> event might lost before re-watch
> --------------------------------
>
> Key: ZOOKEEPER-2217
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2217
> Project: ZooKeeper
> Issue Type: Improvement
> Components: c client, java client
> Affects Versions: 3.4.5, 3.4.6
> Environment: jdk1.7_45 on centos6.5 and ubuntu14.4
> Reporter: Caspian
>
> I use zk to monitor the children nodes under a path, eg: /servers.
> when the client is told that children changes, I have to re-watch the path again, during the peroid, it's possible that some children down, or some up. And those events will be missed.
> For now, my temporary solution is not to use getChildren(path, true...) to get children and re-watch this path, but re-watch this path first, then get the children. Thus non events can be ignored, but I don't know what will the zk server be like if there are too much clients that act like this.
> How do you think of this problem? Is there any other solutions?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)