diff --git a/arangod/Cluster/ApplicationCluster.cpp b/arangod/Cluster/ApplicationCluster.cpp index 1fe991c1a2..6bcb0b5c65 100644 --- a/arangod/Cluster/ApplicationCluster.cpp +++ b/arangod/Cluster/ApplicationCluster.cpp @@ -154,10 +154,15 @@ bool ApplicationCluster::prepare () { LOG_FATAL_AND_EXIT("invalid value specified for --cluster.my-id"); } } + + // initialise ClusterComm library + ClusterComm::instance()->initialise(); // initialise cluster info library ClusterInfo::instance(); + usleep(1000); + return true; } @@ -258,9 +263,6 @@ bool ApplicationCluster::start () { _myAddress.c_str(), ServerState::roleToString(role).c_str()); - // initialise ClusterComm library - ClusterComm::instance()->initialise(); - if (! _disableHeartbeat) { AgencyCommResult result = comm.getValues("Sync/HeartbeatIntervalMs", false); diff --git a/arangod/Cluster/ClusterComm.cpp b/arangod/Cluster/ClusterComm.cpp index ac7d114506..3363d61a48 100644 --- a/arangod/Cluster/ClusterComm.cpp +++ b/arangod/Cluster/ClusterComm.cpp @@ -445,7 +445,7 @@ ClusterCommResult* ClusterComm::wait ( double timeleft; if (0.0 == timeout) { - endtime = 1.0e50; // this is the Sankt Nimmerleinstag + endtime = TRI_microtime() + 24.0 * 60.0 * 60.0; // this is the Sankt Nimmerleinstag } else { endtime = TRI_microtime() + timeout; @@ -895,6 +895,7 @@ void ClusterCommThread::run () { if (0 != _stop) { break; } + { basics::ConditionLocker locker(&cc->somethingToSend); if (cc->toSend.empty()) { diff --git a/js/server/modules/org/arangodb/cluster/kickstarter.js b/js/server/modules/org/arangodb/cluster/kickstarter.js index b06986e662..8158c988fc 100644 --- a/js/server/modules/org/arangodb/cluster/kickstarter.js +++ b/js/server/modules/org/arangodb/cluster/kickstarter.js @@ -285,6 +285,10 @@ launchActions.startServers = function (dispatchers, cmd, isRelaunch) { pids.push(executeExternal(arangodPath, args)); endpoints.push(exchangePort(dispatchers[cmd.dispatcher].endpoint,port)); } + + console.info("Waiting for servers to come to live..."); + wait(5); + return {"error": false, "isStartServers": true, "pids": pids, "endpoints": endpoints, "roles": roles}; };