8000 [3.7] BTS-446 Cluster machines fail to integrate on OSX jenkins runs … · arangodb/arangodb@b2adf44 · GitHub
[go: up one dir, main page]

Skip to content

Commit b2adf44

Browse files
kvahedjsteemannKVS85
authored
[3.7] BTS-446 Cluster machines fail to integrate on OSX jenkins runs (#14282)
* give the bootstrap process a little time * Update CHANGELOG Co-authored-by: Jan <jsteemann@users.noreply.github.com> * Update CHANGELOG Co-authored-by: Jan <jsteemann@users.noreply.github.com> Co-authored-by: Vadim <vadim@arangodb.com>
1 parent 338fd4b commit b2adf44

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
v3.7.13 (XXXX-XX-XX)
22
--------------------
33

4+
* Fix BTS-446: When finding a not yet fully initialized agency, do not
5+
immediately fatal exit. Keep trying for (very generous) 5 minutes.
6+
47
* Fix DEVSUP-753: now it is safe to call visit on exhausted disjunction
58
iterator.
69

arangod/Cluster/ServerState.cpp

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -664,10 +664,25 @@ bool ServerState::checkIfAgencyInitialized(AgencyComm& comm,
664664
//////////////////////////////////////////////////////////////////////////////
665665

666666
bool ServerState::registerAtAgencyPhase1(AgencyComm& comm, ServerState::RoleEnum const& role) {
667-
// if the agency is not initialized, there is no point in continuing.
668-
if (!checkIfAgencyInitialized(comm, role)) {
669-
return false;
670-
}
667+
668+
// if the agency is not initialized, we'll give the bunch a little time to get their
669+
// act together before calling it a day.
670+
671+
using namespace std::chrono;
672+
using clock = steady_clock;
673+
auto registrationTimeout = clock::now() + seconds(300);
674+
auto backoff = milliseconds(75);
675+
do {
676+
if (checkIfAgencyInitialized(comm, role)) {
677+
break;
678+
} else if (clock::now() >= registrationTimeout) {
679+
return false;
680+
}
681+
std::this_thread::sleep_for(backoff);
682+
if (backoff < seconds(1)) {
683+
backoff += backoff;
684+
}
685+
} while (!_server.isStopping());
671686

672687
std::string const agencyListKey = roleToAgencyListKey(role);
673688
std::string const latestIdKey = "Latest" + roleToAgencyKey(role) + "Id";

0 commit comments

Comments
 (0)
0