The client library is in charge of preventing expirations, if it happens it is
probably because of dead servers or network problems that caused a spike in
latency.
Increasing your session timeout helps prevent this.
If/when it happens, you need create another ZooKeeper object to reconnect to
ZooKeeper. If you had any ephemeral nodes, they will be gone. For
applications that are just reading things from ZooKeeper or updating status
znodes the recovery is very simple. For master applications that setup
complex ZooKeeper subtrees with ephemeral znodes at initialization, they need
to rerun initialization logic. From ZooKeeper's point of view, the
application has restarted when a new ZooKeeper object is recreated.
ben
On Tuesday 17 June 2008 00:34:58 Avinash Lakshman wrote:
> How do prevent my session from timing out? I get this exception:
>
> Priming connection to java.nio.channels.SocketChannel[connected local=/
> 10.16.138.101:8352 remote=fool.xyz.com/10.18.39.211:5001]
> WARN - Closing:
> java.io.IOException: Session Expired
> at
> com.yahoo.zookeeper.ClientCnxn$SendThread.readConnectResult(ClientCnxn.java
>:406) at
> com.yahoo.zookeeper.ClientCnxn$SendThread.doIO(ClientCnxn.java:492)
> at
> com.yahoo.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:705)
> ERROR - from SendThread
> java.lang.NoSuchMethodError: org.apache.log4j.Logger.isTraceEnabled()Z
> at
> com.yahoo.zookeeper.server.ZooTrace.isTraceEnabled(ZooTrace.java:63)
> at
> com.yahoo.zookeeper.server.ZooTrace.logTraceMessage(ZooTrace.java:67)
> at
> com.yahoo.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:732)
>
> Why would this happen and how can I prevent this from happening? How should
> the software react to this situation?:
>
> Avinash
|