zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Churu Tang <ct...@rubiconproject.com>
Subject Re: watch my ephemeral node during network disconnect
Date Mon, 16 Mar 2015 17:17:22 GMT
I find this in apache document. So you are right in the automatically registration as well.

When a client reconnects, any previously registered watches will be reregistered and triggered
if needed.
Really appreciated for the help!

Cheers,
Churu

On Mar 15, 2015, at 9:19 PM, Cameron McKenzie <mckenzie.cam@gmail.com> wrote:

> Any state changes that occur in ZK while you're not connected will not be
> fired by the watch.
> So,
> 1.) Yes, you're disconnected so no watch can be fired.
> 2.) From memory the ZK client will automatically reregister watches (I
> could be wrong on this though) when you reconnect. Once reconnected though,
> the ephemeral node will no longer exist so, depending on your watch type
> (exists, children etc.) it won't fire until the ephemeral node is recreated.
> 
> Once a watch has fired it is gone. You need to register another watch if
> you want to be informed of subsequent events for the given node.
> cheers
> 
> 
> On Mon, Mar 16, 2015 at 3:10 PM, Churu Tang <ctang@rubiconproject.com>
> wrote:
> 
>> I see. So the watcher will not be triggered because:
>> (1) at stage 3, nt’s disconnected
>> (2) at stage 4, this watcher has already been triggered in stage 3 and
>> will not be triggered again. Each watcher will only be triggered once
>> unless we manually add the watcher again after it’s triggered.
>> 
>> Please correct me if I am wrong.
>> Thanks!
>> 
>> Cheers,
>> Churu
>> 
>> On Mar 15, 2015, at 7:20 PM, Cameron McKenzie <mckenzie.cam@gmail.com>
>> wrote:
>> 
>>> On
>>> reconnection, watches need to be reset, so you wouldn't get an event
>> until
>>> the ephemeral node is created / deleted again.
>> 
>> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message