summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-02-28 12:50:54 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2022-02-28 12:50:54 +0000
commit97d11fe1b41ea71291b0e027325224d28a963b07 (patch)
treeb31d16cca16f0019180c9e3465f8db75a71f198a /searchcore
parent5a51cc51bf80f4d7c1afa1993e7df6c50a6e3d71 (diff)
Use the InvokeService to tick the clock instead of having a dedicated separate thread.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/apps/proton/proton.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/proton.cpp8
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 8bd965497a8..fd174e784d0 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");
}