zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Gius <mgius7...@gmail.com>
Subject session expire closes handle?
Date Fri, 10 Feb 2012 00:04:59 GMT
According to http://wiki.apache.org/hadoop/ZooKeeper/FAQ#A3:

"SESSION_EXPIRED automatically closes the ZooKeeper handle."

What does it mean that the zookeeper handle is closed?  I'm assuming this
refers to the zookeeper handle that is returned by zookeeper.init.  If that
is the case, then I'm not seeing this handle being "closed" and then
cleaned up.  When I perform the following steps:

 - zookeeper.init
   - handle is 0
 - wait for session to connect
 - force a session expiration
 - wait for client to show session expiration

At this point I can clearly see that handle 0 cannot be used for any real
work.  I can use zoo_client_id to get the now expired session id,
zookeeper.is_unrecoverable(0) returns INVALIDSTATE, but if I call
zookeeper.close(0) the call blocks indefinitely.  Calling zookeeper.init to
get a new session gives me handle "1".  Normally after a successful
close(0) the next call to zookeeper.init gives me handle 0 again.

Am I doing something wrong here?  I feel that I shouldn't have lingering
zookeeper handles every time a session expires, but that's seems to be my
only option right now.


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