diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-02-28 21:28:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-28 21:28:50 +0100 |
commit | 5ee0b5b9df79a1b817e358b96e81f97f27f17de6 (patch) | |
tree | c53a73f48aaf1793be6df66b5ca8b74df39d39de /searchcore | |
parent | b85550c436c62a6ab692bde0313eeff6940b1744 (diff) | |
parent | 97d11fe1b41ea71291b0e027325224d28a963b07 (diff) |
Merge pull request #21456 from vespa-engine/balder/let-invokeservice-tick-the-clock
Use the InvokeService to tick the clock instead of having a dedicated…
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/apps/proton/proton.cpp | 2 | ||||
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/server/proton.cpp | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/searchcore/src/apps/proton/proton.cpp b/searchcore/src/apps/proton/proton.cpp index b806d2b0459..ab273fd2660 100644 --- a/searchcore/src/apps/proton/proton.cpp +++ b/searchcore/src/apps/proton/proton.cpp @@ -219,7 +219,7 @@ App::startAndRun(FastOS_ThreadPool & threadPool, FNET_Transport & transport) { spiProton->createNode(); EV_STARTED("servicelayer"); } else { - proton.getMetricManager().init(identityUri, proton.getThreadPool()); + proton.getMetricManager().init(identityUri, threadPool); } EV_STARTED("proton"); while (!(SIG::INT.check() || SIG::TERM.check() || (spiProton && spiProton->getNode().attemptedStopped()))) { diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp index c483a4c71bb..974c2522565 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp @@ -241,7 +241,7 @@ Proton::Proton(FastOS_ThreadPool & threadPool, FNET_Transport & transport, const _shared_service(), _compile_cache_executor_binding(), _queryLimiter(), - _clock(1.0/vespalib::getVespaTimerHz()), + _clock(), _distributionKey(-1), _isInitializing(true), _abortInit(false), @@ -259,9 +259,6 @@ Proton::init() { assert( ! _initStarted && ! _initComplete ); _initStarted = true; - if (_threadPool.NewThread(_clock.getRunnable(), nullptr) == nullptr) { - throw IllegalStateException("Failed starting thread for the cheap clock"); - } _protonConfigFetcher.start(_threadPool); auto configSnapshot = _protonConfigurer.getPendingConfigSnapshot(); assert(configSnapshot); @@ -281,6 +278,7 @@ Proton::init(const BootstrapConfig::SP & configSnapshot) setBucketCheckSumType(protonConfig); setFS4Compression(protonConfig); _shared_service = std::make_unique<SharedThreadingService>(SharedThreadingServiceConfig::make(protonConfig, hwInfo.cpu()), _transport); + _clock.start(_shared_service->invokeService()); _diskMemUsageSampler = std::make_unique<DiskMemUsageSampler>(_shared_service->transport(), protonConfig.basedir, diskMemUsageSamplerConfig(protonConfig, hwInfo)); @@ -475,8 +473,8 @@ Proton::~Proton() _persistenceEngine.reset(); _tls.reset(); _compile_cache_executor_binding.reset(); - _shared_service.reset(); _clock.stop(); + _shared_service.reset(); LOG(debug, "Explicit destructor done"); } |