Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address invalid monitoring configuration that prevents Elasticsearch from starting #47249

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,13 @@ public Exporters(Settings settings, Map<String, Exporter.Factory> factories,

private void setExportersSetting(Settings exportersSetting) {
if (this.lifecycle.started()) {
Map<String, Exporter> updated = initExporters(exportersSetting);
closeExporters(logger, this.exporters.getAndSet(updated));
try {
Map<String, Exporter> updated = initExporters(exportersSetting);
closeExporters(logger, this.exporters.getAndSet(updated));
}catch (Exception e){
//swallow exception here since this can be called from cluster state applier
logger.error("Unable set monitoring exporter settings", e);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,12 @@ public void testDynamicIndexFormatChange() throws Exception {
assertThat(newIndex.get("_index"), equalTo(expectedMonitoringIndex));
}

public void testInvalidConfig() {
//bad config could result in cluster state not applying properly see: https://github.com/elastic/elasticsearch/issues/47125
client().admin().cluster().prepareUpdateSettings()
.setTransientSettings(Collections.singletonMap("xpack.monitoring.exporters.foo.use_ingest", true)).execute().actionGet(5000);
}

private void assertMonitorVersion(final MockWebServer webServer) throws Exception {
assertMonitorVersion(webServer, null, null);
}
Expand Down