diff --git a/src/common/zk.cpp b/src/common/zk.cpp index a23cb44ce..de69d552b 100644 --- a/src/common/zk.cpp +++ b/src/common/zk.cpp @@ -44,7 +44,10 @@ namespace jubatus{ } do{ - zh_ = zookeeper_init(hosts.c_str(), NULL, timeout, 0, NULL, 0); + // FIXME?: this loop will call zookeeper_init many times till + // the state got ZOO_CONNECTING_STAT + // timeout is supposed to be ms?? + zh_ = zookeeper_init(hosts.c_str(), NULL, timeout * 1000, 0, NULL, 0); if(zh_ == NULL){ perror(""); throw std::runtime_error("cannot init zk"); diff --git a/src/common/zk.hpp b/src/common/zk.hpp index b4c77488b..50867adae 100644 --- a/src/common/zk.hpp +++ b/src/common/zk.hpp @@ -34,7 +34,8 @@ namespace jubatus{ // TODO: write zk mock and test them all? class zk{ public: - zk(const std::string& hosts, int timeout = 1024, const std::string& logfile = ""); + // timeout [ms] + zk(const std::string& hosts, int timeout = 10, const std::string& logfile = ""); ~zk(); void create(const std::string& path, const std::string& payload = "", bool ephemeral = false); diff --git a/src/server/classifier.cpp b/src/server/classifier.cpp index 31205d7fb..837ec9d67 100644 --- a/src/server/classifier.cpp +++ b/src/server/classifier.cpp @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) cmdline::parser p; p.add("rpc-port", 'p', "port number", false, 9199); p.add("thread", 'c', "thread number", false, 2); - p.add("timeout", 't', "time out", false, 10); + p.add("timeout", 't', "time out (sec)", false, 10); p.add("storage", 'S', "storage type", false, "local"); p.add("zookeeper", 'z', "zookeeper location", false); p.add("name", 'n', "learning machine instance name", true);