Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Zookeeper, mail # user - How to recover previous watcher & event after "session expired"


Copy link to this message
-
Re: How to recover previous watcher & event after "session expired"
Camille Fournier 2012-05-18, 22:20
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
expired.

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, 李赫元 <[EMAIL PROTECTED]> 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 !