zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Hunt <ph...@apache.org>
Subject Re: SessionExpiredException. help please
Date Fri, 23 Sep 2011 22:24:54 GMT
Take a look at the docs, in particular information on sessions:
"One of the parameters to the ZooKeeper client library call to create
a ZooKeeper session is the session timeout in milliseconds. The client
sends a requested timeout, the server responds with the timeout that
it can give the client. The current implementation requires that the
timeout be a minimum of 2 times the tickTime (as set in the server
configuration) and a maximum of 20 times the tickTime. The ZooKeeper
client API allows access to the negotiated timeout."

You can change the max limit imposed by the server, see here:

You should be able to see in the logs what the negotiated session timeout was.

This likely indicates that your client is pausing for long periods of
time -- the most common case is GC pause. See the troubleshooting
try turning on verbose GC logging to verify.


On Fri, Sep 23, 2011 at 2:49 PM, Yuhan Zhang <yzhang@onescreen.com> wrote:
> Hi all,
> I set the sessionTimeout value to be "Integer.MAX_VALUE" to the constructor
> as
>  zooKeeper = new ZooKeeper(host, Integer.MAX_VALUE, this);
> but reached an "session expired" exception when requesting a create
> operation twice on the following line:
> lockPath = zooKeeper.create( lockFolder + "/0", new byte[0],
> Exception:
> org.apache.zookeeper.KeeperException$SessionExpiredException :
> KeeperErrorCode = Session expired for /_lock/0
> why does this happen? could anyone give some advice?
> Thank you.
> Yuhan

View raw message