ZooKeeper server startup fails if configured only with the 'minSessionTimeout'
and not 'maxSessionTimeout'
----------------------------------------------------------------------------------------------------------
Key: ZOOKEEPER-1213
URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1213
Project: ZooKeeper
Issue Type: Bug
Components: server
Affects Versions: 3.3.3
Reporter: Rakesh R
Assignee: Rakesh R
I have configured only the 'minSessionTimeout' and not configured
'maxSessionTimeout' in the zoo.cfg file as follows
+zoo.cfg+
tickTime=2000
minSessionTimeout=10000
I'm seeing the following exception and not starting the ZooKeeper server
{noformat}
2011-10-07 23:39:10,546 - INFO [main:QuorumPeerConfig@100] - Reading
configuration from: /home/rakeshr/zookeeper/bin/../conf/zoo.cfg
2011-10-07 23:39:12,334 - ERROR [main:QuorumPeerMain@85] - Invalid config,
exiting abnormally
org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error
processing /home/rakeshr/zookeeper/bin/../conf/zoo.cfg
at
org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:120)
at
org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:101)
at
org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78)
Caused by: java.lang.IllegalArgumentException: minSessionTimeout must not be
larger than maxSessionTimeout
at
org.apache.zookeeper.server.quorum.QuorumPeerConfig.parseProperties(QuorumPeerConfig.java:265)
at
org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:116)
... 2 more
{noformat}
Startup fails due to the following validation. Here maxSessionTimeout value is
-1 rather than the upper limit (tickTime * 2)
{noformat}
/** defaults to -1 if not set explicitly */
protected int maxSessionTimeout = -1;
if (minSessionTimeout > maxSessionTimeout) {
throw new IllegalArgumentException(
"minSessionTimeout must not be larger than
maxSessionTimeout");
}
{noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira