zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Flavio Junqueira" <fpjunque...@yahoo.com.INVALID>
Subject RE: Watch: One time event -> Loss of event
Date Thu, 12 Jun 2014 17:35:32 GMT
Hi there,

You don't miss events if you read the state of zk again and compare what has
changed. While reading the state, you set another watch, this is how you
don't miss events.


-----Original Message-----
From: Mudit Verma [mailto:mudit.f2004912@gmail.com] 
Sent: Thursday, June 12, 2014 4:40 PM
To: user@zookeeper.apache.org
Subject: Watch: One time event -> Loss of event

Hi All, 

In my last couple of projects, I have heavily used zookeeper watches.
However, ZK watch is a one time event.  

I strongly feel that zookeeper should have a way to set a watch permanently
(unless removed by the user through an API or the znode is deleted). This
would guarantee that no data change event is missed by the client.
Otherwise, we can miss data change event that occurs between receiving the
call back from previous watch and resetting the new watch again.  This
problem is also stated in documentation. 

I am sure even others might have felt this need sometime or the other.  This
missing capability makes ZK watcher functionality best effort and not full
proof.  Consequently, clients who can not afford to miss any event, can not
use ZooKeeper reliably. 

I think we should have these APIs unless there is some theoretical or
practical problem with these. 

1. API to set a watch permanently.  
2. Removing a watch when not needed. 

Looking forward for a discussion.


View raw message