diff --git a/arangod/Agency/Inception.cpp b/arangod/Agency/Inception.cpp index 18f133f71a..75f5a248b8 100644 --- a/arangod/Agency/Inception.cpp +++ b/arangod/Agency/Inception.cpp @@ -28,6 +28,7 @@ #include "Agency/MeasureCallback.h" #include "Basics/ConditionLocker.h" #include "Cluster/ClusterComm.h" +#include "GeneralServer/RestHandlerFactory.h" #include #include @@ -490,6 +491,13 @@ bool Inception::activeAgencyFromCommandLine() { // @brief Thread main void Inception::run() { + while (arangodb::rest::RestHandlerFactory::isMaintenance() && + !this->isStopping() && !_agent->isStopping()) { + usleep(1000000); + LOG_TOPIC(DEBUG, Logger::AGENCY) + << "Waiting for RestHandlerFactory to exit maintenance mode before we " + " start gossip protocol..."; + } // 1. If active agency, do as you're told if (activeAgencyFromPersistence()) {