1
0
Fork 0

fixed race conditions

This commit is contained in:
Jan Steemann 2014-02-19 14:53:13 +01:00
parent 726144ce39
commit dd5b172e2c
3 changed files with 11 additions and 4 deletions

View File

@ -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);

View File

@ -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()) {

View File

@ -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};
};