1
0
Fork 0

fix shutdown order

This commit is contained in:
jsteemann 2017-05-11 20:59:36 +02:00
parent 68611a0a6a
commit 68b4b2f393
3 changed files with 26 additions and 0 deletions

View File

@ -58,6 +58,7 @@ ClusterFeature::ClusterFeature(application_features::ApplicationServer* server)
setOptional(true);
requiresElevatedPrivileges(false);
startsAfter("Authentication");
startsAfter("CacheManager");
startsAfter("Logger");
startsAfter("WorkMonitor");
startsAfter("Database");
@ -571,6 +572,8 @@ void ClusterFeature::unprepare() {
AgencyCommManager::MANAGER->stop();
ClusterComm::cleanup();
ClusterInfo::cleanup();
}
void ClusterFeature::setUnregisterOnShutdown(bool unregisterOnShutdown) {

View File

@ -213,6 +213,23 @@ ClusterInfo::ClusterInfo(AgencyCallbackRegistry* agencyCallbackRegistry)
////////////////////////////////////////////////////////////////////////////////
ClusterInfo::~ClusterInfo() {}
////////////////////////////////////////////////////////////////////////////////
/// @brief cleanup method which frees cluster-internal shared ptrs on shutdown
////////////////////////////////////////////////////////////////////////////////
void ClusterInfo::cleanup() {
ClusterInfo* theInstance = instance();
if (theInstance == nullptr) {
return;
}
theInstance->_plannedCollections.clear();
theInstance->_shards.clear();
theInstance->_shardKeys.clear();
theInstance->_shardIds.clear();
theInstance->_currentCollections.clear();
}
////////////////////////////////////////////////////////////////////////////////
/// @brief increase the uniqid value. if it exceeds the upper bound, fetch a

View File

@ -251,6 +251,12 @@ class ClusterInfo {
//////////////////////////////////////////////////////////////////////////////
static ClusterInfo* instance();
//////////////////////////////////////////////////////////////////////////////
/// @brief cleanup method which frees cluster-internal shared ptrs on shutdown
//////////////////////////////////////////////////////////////////////////////
static void cleanup();
public:
//////////////////////////////////////////////////////////////////////////////