mirror of https://gitee.com/bigwinds/arangodb
multi-host agency tests startup ok
This commit is contained in:
commit
9134933158
|
@ -197,10 +197,8 @@ void AgencyFeature::unprepare() {
|
|||
return;
|
||||
}
|
||||
|
||||
LOG_TOPIC(WARN, Logger::AGENCY) << __func__ << __LINE__;
|
||||
|
||||
_agent->beginShutdown();
|
||||
|
||||
|
||||
if (_agent != nullptr) {
|
||||
int counter = 0;
|
||||
while (_agent->isRunning()) {
|
||||
|
@ -212,6 +210,4 @@ void AgencyFeature::unprepare() {
|
|||
}
|
||||
}
|
||||
|
||||
LOG_TOPIC(WARN, Logger::AGENCY) << __func__ << __LINE__;
|
||||
|
||||
}
|
||||
|
|
|
@ -271,7 +271,7 @@ append_entries_t Agent::sendAppendEntriesRPC(
|
|||
"1", 1, _config.endpoints[follower_id],
|
||||
arangodb::GeneralRequest::RequestType::POST, path.str(),
|
||||
std::make_shared<std::string>(builder.toJson()), headerFields,
|
||||
std::make_shared<AgentCallback>(this, follower_id, last), 0, true);
|
||||
std::make_shared<AgentCallback>(this, follower_id, last), 1, true);
|
||||
|
||||
return append_entries_t(t, true);
|
||||
}
|
||||
|
@ -392,9 +392,12 @@ void Agent::beginShutdown() {
|
|||
_spearhead.beginShutdown();
|
||||
_readDB.beginShutdown();
|
||||
|
||||
|
||||
CONDITION_LOCKER(guardW, _waitForCV);
|
||||
guardW.broadcast();
|
||||
// Wake up all waiting REST handler (waitFor)
|
||||
CONDITION_LOCKER(guard, _appendCV);
|
||||
guard.broadcast();
|
||||
CONDITION_LOCKER(guardA, _appendCV);
|
||||
guardA.broadcast();
|
||||
}
|
||||
|
||||
// Becoming leader
|
||||
|
|
|
@ -364,6 +364,10 @@ void Constituent::callElection() {
|
|||
void Constituent::beginShutdown() {
|
||||
_notifier.reset();
|
||||
Thread::beginShutdown();
|
||||
|
||||
CONDITION_LOCKER(guard, _cv);
|
||||
guard.broadcast();
|
||||
|
||||
}
|
||||
|
||||
bool Constituent::start(TRI_vocbase_t* vocbase,
|
||||
|
@ -430,4 +434,5 @@ void Constituent::run() {
|
|||
callElection(); // Run for office
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -77,6 +77,7 @@ void NotifierThread::run() {
|
|||
} catch (...) {
|
||||
LOG(ERR) << "Couldn't notify agents!";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void NotifierThread::beginShutdown() {
|
||||
|
|
|
@ -131,8 +131,10 @@ Store& Store::operator=(Store&& rhs) {
|
|||
return *this;
|
||||
}
|
||||
|
||||
// Default ctor
|
||||
Store::~Store() {}
|
||||
// Default dtor
|
||||
Store::~Store() {
|
||||
shutdown();
|
||||
}
|
||||
|
||||
// Apply queries multiple queries to store
|
||||
std::vector<bool> Store::apply(query_t const& query) {
|
||||
|
@ -495,6 +497,7 @@ void Store::run() {
|
|||
toClear = clearExpired();
|
||||
_agent->write(toClear);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool Store::applies(arangodb::velocypack::Slice const& slice) {
|
||||
|
|
|
@ -262,7 +262,7 @@ void Supervision::run() {
|
|||
workJobs();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Supervision::workJobs() {
|
||||
|
@ -385,6 +385,10 @@ void Supervision::updateFromAgency() {
|
|||
void Supervision::beginShutdown() {
|
||||
// Personal hygiene
|
||||
Thread::beginShutdown();
|
||||
|
||||
CONDITION_LOCKER(guard, _cv);
|
||||
guard.broadcast();
|
||||
|
||||
}
|
||||
|
||||
Store const& Supervision::store() const {
|
||||
|
|
Loading…
Reference in New Issue