Skip to content

Commit 63ca8b8

Browse files
authored
Start readiness service after http is started (#136729) (#136922)
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 d2c42d9 commit 63ca8b8

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
@@ -293,9 +293,6 @@ public Node start() throws NodeValidationException {
293293
logger.info("starting ...");
294294
pluginLifecycleComponents.forEach(LifecycleComponent::start);
295295

296-
if (ReadinessService.enabled(environment)) {
297-
injector.getInstance(ReadinessService.class).start();
298-
}
299296
injector.getInstance(MappingUpdatedAction.class).setClient(client);
300297
injector.getInstance(IndicesService.class).start();
301298
injector.getInstance(IndicesClusterStateService.class).start();
@@ -425,6 +422,9 @@ public void onTimeout(TimeValue timeout) {
425422
}
426423

427424
injector.getInstance(HttpServerTransport.class).start();
425+
if (ReadinessService.enabled(environment)) {
426+
injector.getInstance(ReadinessService.class).start();
427+
}
428428

429429
if (WRITE_PORTS_FILE_SETTING.get(settings())) {
430430
TransportService transport = injector.getInstance(TransportService.class);

0 commit comments

Comments
 (0)