Don't Start Redundant ConsistentSettingsService (#62283) (#62428)

The consistent settings service is only used in tests so far. No need to start it
unless it's actually used.
This commit is contained in:
Armin Braun 2020-09-16 09:43:04 +02:00 committed by GitHub
parent f3ed641fc7
commit f6a8599cf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -399,9 +399,11 @@ public class Node implements Closeable {
final ClusterService clusterService = new ClusterService(settings, settingsModule.getClusterSettings(), threadPool);
clusterService.addStateApplier(scriptService);
resourcesToClose.add(clusterService);
clusterService.addLocalNodeMasterListener(
new ConsistentSettingsService(settings, clusterService, settingsModule.getConsistentSettings())
.newHashPublisher());
final Set<Setting<?>> consistentSettings = settingsModule.getConsistentSettings();
if (consistentSettings.isEmpty() == false) {
clusterService.addLocalNodeMasterListener(
new ConsistentSettingsService(settings, clusterService, consistentSettings).newHashPublisher());
}
final IngestService ingestService = new IngestService(clusterService, threadPool, this.environment,
scriptService, analysisModule.getAnalysisRegistry(),
pluginsService.filterPlugins(IngestPlugin.class), client);