Skip to content

Commit 997e92c

Browse files
authored
Start readiness service after http is started (#136729)
The readiness service indicates when ES is ready to receive external http requests. Yet the service does not actually check http has been started. This commit moves the starting the readiness service to after http has been started. Note that adding a direct dependency between ReadinessService and HttpServerTransport would be complicated, so the "dependency" is achieved by starting readiness almost at the end of node startup.
1 parent a76c839 commit 997e92c

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

docs/changelog/136729.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 136729
2+
summary: Start readiness service after http is started
3+
area: Infra/Node Lifecycle
4+
type: bug
5+
issues: []

server/src/main/java/org/elasticsearch/node/Node.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,6 @@ public Node start() throws NodeValidationException {
278278
logger.info("starting ...");
279279
pluginLifecycleComponents.forEach(LifecycleComponent::start);
280280

281-
if (ReadinessService.enabled(environment)) {
282-
injector.getInstance(ReadinessService.class).start();
283-
}
284281
injector.getInstance(MappingUpdatedAction.class).setClient(client);
285282
injector.getInstance(IndicesService.class).start();
286283
injector.getInstance(IndicesClusterStateService.class).start();
@@ -409,6 +406,9 @@ public void onTimeout(TimeValue timeout) {
409406
}
410407

411408
injector.getInstance(HttpServerTransport.class).start();
409+
if (ReadinessService.enabled(environment)) {
410+
injector.getInstance(ReadinessService.class).start();
411+
}
412412

413413
if (WRITE_PORTS_FILE_SETTING.get(settings())) {
414414
TransportService transport = injector.getInstance(TransportService.class);

0 commit comments

Comments
 (0)