hadoop-zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Hunt <ph...@apache.org>
Subject Re: How to reconnect server when the session expired?
Date Tue, 29 Sep 2009 07:28:43 GMT
When the session expires your only option is to create a new session and 
re-register the watches, re-create ephemerals, etc...

Patrick

YeQian.ZJU@gmail.com wrote:
> Hi all:
> 
> When used Zookeeper in my project, I noticed a problem about the 
> session. When a session expired, the io thread of the client just return,
> void *do_io(void *v)
> {
> ...
> while(!zh->close_requested) {
> if(is_unrecoverable(zh))
> break;
> }
> ...
> }
> 
> However, in my scenario, I want to reconnect to the Zookeeper Server and 
> recover the watcher which have been set for the last session. How to do 
> it? Just close the last zookeeper handler and init a new one, and add 
> all the watchers again? Is there a more efficient way?
> 
> Thanks!
> 

Mime
View raw message