-Re: SessionExpiredException. help please
Yuhan Zhang 2011-09-23, 23:46
Thanks for the remark. I will look into the timeout limit setting.
also, is auto-reconnection available through zooKeeper API?
I'd like to keep a very long session/connection. Is this a good practice
On Fri, Sep 23, 2011 at 3:24 PM, Patrick Hunt <[EMAIL PROTECTED]> wrote:
> 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
> 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 <[EMAIL PROTECTED]> wrote:
> > Hi all,
> > I set the sessionTimeout value to be "Integer.MAX_VALUE" to the
> > 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,
> > Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL);
> > Exception:
> > org.apache.zookeeper.KeeperException$SessionExpiredException :
> > KeeperErrorCode = Session expired for /_lock/0
> > why does this happen? could anyone give some advice?
> > Thank you.
> > Yuhan