Guard against following the nullptr.
@@ -235,9 +235,9 @@ Proton::init(const BootstrapConfig::SP & configSnapshot)
(protonConfig.basedir,
diskMemUsageSamplerConfig(protonConfig, hwInfo));
+ _tls = std::make_unique<TLS>(_configUri.createWithNewId(protonConfig.tlsconfigid), _fileHeaderContext);
_metricsEngine->addMetricsHook(_metricsHook);
_fileHeaderContext.setClusterName(protonConfig.clustername, protonConfig.basedir);
- _tls.reset(new TLS(_configUri.createWithNewId(protonConfig.tlsconfigid), _fileHeaderContext));
_matchEngine.reset(new MatchEngine(protonConfig.numsearcherthreads,
protonConfig.numthreadspersearch,
protonConfig.distributionkey));
@@ -686,7 +686,11 @@ Proton::updateMetrics(const vespalib::MonitorGuard &)
{
{
ContentProtonMetrics &metrics = _metricsEngine->root();
- metrics.transactionLog.update(_tls->getTransLogServer()->getDomainStats());
+ auto tls = _tls->getTransLogServer();
+ if (tls) {
+ metrics.transactionLog.update(tls->getDomainStats());
+ }
+
const DiskMemUsageFilter &usageFilter = _diskMemUsageSampler->writeFilter();
DiskMemUsageState usageState = usageFilter.usageState();
metrics.resourceUsage.disk.set(usageState.diskState().usage());
@@ -700,11 +704,17 @@ Proton::updateMetrics(const vespalib::MonitorGuard &)
{
LegacyProtonMetrics &metrics = _metricsEngine->legacyRoot();
metrics.executor.update(_executor.getStats());
+ if (_flushEngine) {
metrics.flushExecutor.update(_flushEngine->getExecutorStats());
+ }
+ if (_matchEngine) {
metrics.matchExecutor.update(_matchEngine->getExecutorStats());
+ }
+ if (_summaryEngine) {
metrics.summaryExecutor.update(_summaryEngine->getExecutorStats());
}
}
+}
void
Proton::waitForInitDone()
