Hey,

More information from ZooKeeper guys. Maybe should I open a JIRA issue ?


"Hi Julien,

take a look at the FAQ for some background:
http://wiki.apache.org/hadoop/ZooKeeper/FAQ#A3

Basically when your client connects to the server it provides a "timeout" value. If the server doesn't hear from your client within this timeout period (we do heartbeating for you in a background thread, you don't have to worry about this) then it will expire the session. http://hadoop.apache.org/zookeeper/docs/current/zookeeperProgrammers.html#ch_zkSessions

You have a watcher for the session - it will be notified both on disconnect but also when/if the session is expired. An expired session is invalid, if this happens you have to create a new session. This is different from a disconnect notification, where you just wait for the client library to reconnect you to the cluster (say you lose connectivity to the server)

Patrick"

On 21 April 2010 12:31, Julien Vey <[email protected]> wrote:
Hi,

I've asked the question on the zookeeper mailing list. I had an answer from
[email protected]

"so far as I know, you should keep an eye on your client handler and
reconnect to Zookeeper server when it is expired youself. It's the solution
in my application for this kind of situation."

I have been looking in the source and I don't know if it the right place to
do it but, in the processDelta method of
org.apache.cxf.dosgi.discovery.zookeeper.InterfaceMonitor, when the
Exception is catched, I think it should check if it's an
ConnectionLossException, then try to reconnect.

Tell me what you think of it

It sounds like a good approach to me. I think Marc is offline at the
moment, but it would be good to get his feedback too.

Cheers,

David



Reply via email to