mirror of https://gitee.com/bigwinds/arangodb
hunting down invalid mutex in shutdown of agency
This commit is contained in:
parent
b73a811c65
commit
ac2fc7b8a0
|
@ -44,7 +44,7 @@ AgencyFeature::AgencyFeature(application_features::ApplicationServer* server)
|
||||||
_notify(false),
|
_notify(false),
|
||||||
_supervision(false),
|
_supervision(false),
|
||||||
_waitForSync(true),
|
_waitForSync(true),
|
||||||
_supervisionFrequency(5.0),
|
_supervisionFrequency(1.0),
|
||||||
_compactionStepSize(1000) {
|
_compactionStepSize(1000) {
|
||||||
setOptional(true);
|
setOptional(true);
|
||||||
requiresElevatedPrivileges(false);
|
requiresElevatedPrivileges(false);
|
||||||
|
|
|
@ -381,13 +381,15 @@ void Agent::beginShutdown() {
|
||||||
// Personal hygiene
|
// Personal hygiene
|
||||||
Thread::beginShutdown();
|
Thread::beginShutdown();
|
||||||
|
|
||||||
|
// Stop supervision
|
||||||
|
if (_config.supervision) {
|
||||||
|
_supervision.beginShutdown();
|
||||||
|
}
|
||||||
|
|
||||||
// Stop constituent and key value stores
|
// Stop constituent and key value stores
|
||||||
_constituent.beginShutdown();
|
_constituent.beginShutdown();
|
||||||
_spearhead.beginShutdown();
|
_spearhead.beginShutdown();
|
||||||
_readDB.beginShutdown();
|
_readDB.beginShutdown();
|
||||||
if (_config.supervision) {
|
|
||||||
_supervision.beginShutdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Wake up all waiting REST handler (waitFor)
|
// Wake up all waiting REST handler (waitFor)
|
||||||
CONDITION_LOCKER(guard, _appendCV);
|
CONDITION_LOCKER(guard, _appendCV);
|
||||||
|
|
|
@ -124,7 +124,9 @@ std::vector<check_t> Supervision::checkDBServers() {
|
||||||
report->close();
|
report->close();
|
||||||
report->close();
|
report->close();
|
||||||
report->close();
|
report->close();
|
||||||
_agent->write(report);
|
if (!this->isStopping()) {
|
||||||
|
_agent->write(report);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,7 +237,7 @@ bool Supervision::start(Agent* agent) {
|
||||||
bool Supervision::updateAgencyPrefix (size_t nTries, int intervalSec) {
|
bool Supervision::updateAgencyPrefix (size_t nTries, int intervalSec) {
|
||||||
|
|
||||||
// Try nTries to get agency's prefix in intervals
|
// Try nTries to get agency's prefix in intervals
|
||||||
for (size_t i = 0; i < nTries; i++) {
|
while (!this->isStopping()) {
|
||||||
_snapshot = _agent->readDB().get("/");
|
_snapshot = _agent->readDB().get("/");
|
||||||
if (_snapshot.children().size() > 0) {
|
if (_snapshot.children().size() > 0) {
|
||||||
_agencyPrefix = std::string("/") + _snapshot.children().begin()->first;
|
_agencyPrefix = std::string("/") + _snapshot.children().begin()->first;
|
||||||
|
@ -256,7 +258,7 @@ void Supervision::getUniqueIds() {
|
||||||
uint64_t latestId;
|
uint64_t latestId;
|
||||||
// Run forever, supervision does not make sense before the agency data
|
// Run forever, supervision does not make sense before the agency data
|
||||||
// is initialized by some other server...
|
// is initialized by some other server...
|
||||||
while (true) {
|
while (!this->isStopping()) {
|
||||||
try {
|
try {
|
||||||
latestId = std::stoul(
|
latestId = std::stoul(
|
||||||
_agent->readDB().get(_agencyPrefix + "/Sync/LatestID").slice().toJson());
|
_agent->readDB().get(_agencyPrefix + "/Sync/LatestID").slice().toJson());
|
||||||
|
|
Loading…
Reference in New Issue