zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Camille Fournier <cami...@apache.org>
Subject Re: How to recover previous watcher & event after "session expired"
Date Fri, 18 May 2012 22:20:40 GMT
I'm not sure what you mean in question #1. A session expired event
generally causes the client to become completely invalid, you could
wrap the client in your own logic to record what you were watching,
but I don't think you can get that out of the client after it's

2. You won't be able to see events that happened when the session was
expired. The server has closed your connection and won't know to send
you events unless you have a valid session with a valid watch.

3. Reconnect won't work on expired sessions, you need to create an
entirely new session. Reconnect works when you get disconnected but
not expired.

Hope that helps
On Fri, May 18, 2012 at 12:18 PM, 李赫元 <liheyuan.bj@gmail.com> wrote:
> Hi, All
> I'm dealing with the case of "session expired" event. Please help me
> with the following question.
> 1. After receive "session expired" event, how to recover the watch
> that are setting before expired gracefully?
> 2.Currently, I record the watch setting and call the api to set it
> again after I got "expired event". It will callback for event after
> connection was success again. But what about the event happend between
> I success reinit the session to zk server. Currently, it got lost. Is
> there any way that I can got these events ?
> 3.I try to use reconnect, in zookeeper_init, but does't work. My guess
> is reconnect is only work for connection that are in state connect
> (Not valid after session timeout), is it right?
> Thanks for your help !

View raw message