mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/arangodb/arangodb into devel
This commit is contained in:
commit
f80b36b6ff
|
@ -414,7 +414,8 @@ void Constituent::run() {
|
|||
std::vector<std::string> act = _agent->config().active();
|
||||
while (!this->isStopping() && ((size_t)(find(act.begin(), act.end(), _id) -
|
||||
act.begin()) >= size())) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(5000));
|
||||
CONDITION_LOCKER(guardv, _cv);
|
||||
_cv.wait(5000000);
|
||||
}
|
||||
|
||||
if (size() == 1) {
|
||||
|
@ -431,10 +432,10 @@ void Constituent::run() {
|
|||
|
||||
int32_t left = static_cast<int32_t>(1000000.0 *
|
||||
_agent->config().minPing()),
|
||||
right = static_cast<int32_t>(1000000.0 *
|
||||
_agent->config().maxPing());
|
||||
right = static_cast<int32_t>(1000000.0 *
|
||||
_agent->config().maxPing());
|
||||
long rand_wait =
|
||||
static_cast<long>(RandomGenerator::interval(left, right));
|
||||
static_cast<long>(RandomGenerator::interval(left, right));
|
||||
|
||||
{
|
||||
CONDITION_LOCKER(guardv, _cv);
|
||||
|
@ -454,7 +455,7 @@ void Constituent::run() {
|
|||
callElection(); // Run for office
|
||||
} else {
|
||||
int32_t left =
|
||||
static_cast<int32_t>(100000.0 * _agent->config().minPing());
|
||||
static_cast<int32_t>(100000.0 * _agent->config().minPing());
|
||||
long rand_wait = static_cast<long>(left);
|
||||
{
|
||||
CONDITION_LOCKER(guardv, _cv);
|
||||
|
|
|
@ -1226,6 +1226,8 @@ function shutdownInstance (instanceInfo, options) {
|
|||
let count = 0;
|
||||
let bar = '[';
|
||||
|
||||
var shutdownTime = require('internal').time();
|
||||
|
||||
let toShutdown = instanceInfo.arangods.slice();
|
||||
while (toShutdown.length > 0) {
|
||||
// Once all other servers are shut down, we take care of the agents,
|
||||
|
@ -1241,13 +1243,8 @@ function shutdownInstance (instanceInfo, options) {
|
|||
arangod.exitStatus = statusExternal(arangod.pid, false);
|
||||
|
||||
if (arangod.exitStatus.status === 'RUNNING') {
|
||||
++count;
|
||||
|
||||
if (count % 10 === 0) {
|
||||
bar = bar + '#';
|
||||
}
|
||||
|
||||
if (count > timeout) {
|
||||
if ((require('internal').time() - shutdownTime) > timeout) {
|
||||
print('forcefully terminating ' + yaml.safeDump(arangod.pid) +
|
||||
' after ' + timeout + 's grace period; marking crashy.');
|
||||
serverCrashed = true;
|
||||
|
|
Loading…
Reference in New Issue