mirror of https://gitee.com/bigwinds/arangodb
fixed race conditions
This commit is contained in:
parent
726144ce39
commit
dd5b172e2c
|
@ -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);
|
||||
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue