diff options
3 files changed, 16 insertions, 8 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp index 89940fbf367..30a23aaa3d5 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp @@ -447,11 +447,7 @@ Proton::~Proton() _flushEngine->close(); } if (_shared_service) { - _shared_service->warmup_raw().sync(); - _shared_service->shared_raw()->sync(); - if (_shared_service->field_writer()) { - _shared_service->field_writer()->sync_all(); - } + _shared_service->sync_all_executors(); } if ( ! _documentDBMap.empty()) { @@ -946,7 +942,7 @@ Proton::get_child(vespalib::stringref name) const return std::make_unique<ResourceUsageExplorer>(_diskMemUsageSampler->writeFilter(), _persistenceEngine->get_resource_usage_tracker()); } else if (name == THREAD_POOLS) { - return std::make_unique<ProtonThreadPoolsExplorer>((_shared_service) ? _shared_service->shared_raw().get() : nullptr, + return std::make_unique<ProtonThreadPoolsExplorer>((_shared_service) ? &_shared_service->shared() : nullptr, (_matchEngine) ? &_matchEngine->get_executor() : nullptr, (_summaryEngine) ? &_summaryEngine->get_executor() : nullptr, (_flushEngine) ? &_flushEngine->get_executor() : nullptr, diff --git a/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.cpp b/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.cpp index f9333aa18a5..c4fc79c43fd 100644 --- a/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.cpp @@ -31,4 +31,15 @@ SharedThreadingService::SharedThreadingService(const SharedThreadingServiceConfi } } +SharedThreadingService::~SharedThreadingService() = default; + +void +SharedThreadingService::sync_all_executors() { + _warmup.sync(); + _shared->sync(); + if (_field_writer) { + _field_writer->sync_all(); + } +} + } diff --git a/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.h b/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.h index 12686e4a3c5..6006d484c97 100644 --- a/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.h +++ b/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.h @@ -20,9 +20,10 @@ private: public: SharedThreadingService(const SharedThreadingServiceConfig& cfg); + ~SharedThreadingService(); - vespalib::SyncableThreadExecutor& warmup_raw() { return _warmup; } - std::shared_ptr<vespalib::SyncableThreadExecutor> shared_raw() { return _shared; } + std::shared_ptr<vespalib::Executor> shared_raw() { return _shared; } + void sync_all_executors(); vespalib::ThreadExecutor& warmup() override { return _warmup; } vespalib::ThreadExecutor& shared() override { return *_shared; } |