From 257aefc5c5b31f91bb344072d3f14ef997a256bd Mon Sep 17 00:00:00 2001 From: jsteemann Date: Thu, 25 Aug 2016 14:04:11 +0200 Subject: [PATCH] fix agency shutdown --- arangod/Agency/AgencyFeature.cpp | 10 +++++++++- arangod/Agency/AgencyFeature.h | 5 +++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/arangod/Agency/AgencyFeature.cpp b/arangod/Agency/AgencyFeature.cpp index fce14c3755..bc3c12266a 100644 --- a/arangod/Agency/AgencyFeature.cpp +++ b/arangod/Agency/AgencyFeature.cpp @@ -229,8 +229,16 @@ void AgencyFeature::start() { _agent->load(); } -void AgencyFeature::unprepare() { +void AgencyFeature::beginShutdown() { + if (!isEnabled()) { + return; + } + + // pass shutdown event to _agent so it can notify all its sub-threads + _agent->beginShutdown(); +} +void AgencyFeature::unprepare() { if (!isEnabled()) { return; } diff --git a/arangod/Agency/AgencyFeature.h b/arangod/Agency/AgencyFeature.h index cee475eba7..17a7b373e0 100644 --- a/arangod/Agency/AgencyFeature.h +++ b/arangod/Agency/AgencyFeature.h @@ -20,8 +20,8 @@ /// @author Kaveh Vahedipour //////////////////////////////////////////////////////////////////////////////// -#ifndef ARANGOD_AGENCY_APPLICATION_AGENCY_H -#define ARANGOD_AGENCY_APPLICATION_AGENCY_H 1 +#ifndef ARANGOD_AGENCY_AGENCY_FEATURE_H +#define ARANGOD_AGENCY_AGENCY_FEATURE_H 1 #include "ApplicationFeatures/ApplicationFeature.h" @@ -40,6 +40,7 @@ class AgencyFeature : virtual public application_features::ApplicationFeature { void validateOptions(std::shared_ptr) override final; void prepare() override final; void start() override final; + void beginShutdown() override final; void unprepare() override final; private: