You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Ride Shoot Speak <ri...@googlemail.com> on 2011/02/03 15:38:47 UTC

Why my session does not expire in this situation?

Hi,

I tried to provoke an expired session by connecting a simple C client to a
standalone ZooKeeper. I stopped the ZooKeeper and then just waited some time
(longer than the session timeout). The client switched from CONNECTED to
CONNECTING and stayed there. So far so good. Then I started the ZooKeeper
again. The client changed to CONNECTED again. Well, I expected it to get an
EXPIRED_SESSION because the time it was disconnected was definitely longer
than the session timeout value. Am I wrong here?

regards
Jan

Re: Why my session does not expire in this situation?

Posted by Benjamin Reed <br...@yahoo-inc.com>.
yeah, that will not work. when you restart zookeeper, it resets the 
timeouts. to provoke a session expiration you should reopen the session 
with a different zhandle and immediately close it.

ben

On 02/03/2011 06:38 AM, Ride Shoot Speak wrote:
> Hi,
>
> I tried to provoke an expired session by connecting a simple C client to a
> standalone ZooKeeper. I stopped the ZooKeeper and then just waited some time
> (longer than the session timeout). The client switched from CONNECTED to
> CONNECTING and stayed there. So far so good. Then I started the ZooKeeper
> again. The client changed to CONNECTED again. Well, I expected it to get an
> EXPIRED_SESSION because the time it was disconnected was definitely longer
> than the session timeout value. Am I wrong here?
>
> regards
> Jan