You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "yangkun (JIRA)" <ji...@apache.org> on 2016/07/11 02:32:10 UTC

[jira] [Created] (ZOOKEEPER-2472) ServerConfig#parse(String[]) parse params has problems

yangkun created ZOOKEEPER-2472:
----------------------------------

             Summary: ServerConfig#parse(String[]) parse params has problems
                 Key: ZOOKEEPER-2472
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2472
             Project: ZooKeeper
          Issue Type: Bug
          Components: server
            Reporter: yangkun
            Priority: Minor


When debug zookeeper, run ZooKeeperServerMain then pass 4 args, e.g: 2181 F:\\zk\\data 2000 30, that is:

clientPort = 2181
dataDir = F:\\zk\\data
tickTime = 2000
maxClientCnxns = 30
But ServerConfig#parse(String[]) method has a little problem:

public void parse(String[] args) {
    ...
    if (args.length == 3) {
        tickTime = Integer.parseInt(args[2]);
    }
    if (args.length == 4) {
        maxClientCnxns = Integer.parseInt(args[3]);
    }
}
The problem is:

    if (args.length == 4) {
        maxClientCnxns = Integer.parseInt(args[3]);
    }
It can't parse tickTime, igone the tickTime.This coe snippet should be:

    if (args.length == 4) {
        tickTime = Integer.parseInt(args[2]);
        maxClientCnxns = Integer.parseInt(args[3]);
    }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)