Skip to content

Commit 528a68b

Browse files
authored
Start readiness service after http is started (elastic#136729) (elastic#136924)
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 81097fe commit 528a68b

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
@@ -277,9 +277,6 @@ public Node start() throws NodeValidationException {
277277
logger.info("starting ...");
278278
pluginLifecycleComponents.forEach(LifecycleComponent::start);
279279

280-
if (ReadinessService.enabled(environment)) {
281-
injector.getInstance(ReadinessService.class).start();
282-
}
283280
injector.getInstance(MappingUpdatedAction.class).setClient(client);
284281
injector.getInstance(IndicesService.class).start();
285282
injector.getInstance(IndicesClusterStateService.class).start();
@@ -408,6 +405,9 @@ public void onTimeout(TimeValue timeout) {
408405
}
409406

410407
injector.getInstance(HttpServerTransport.class).start();
408+
if (ReadinessService.enabled(environment)) {
409+
injector.getInstance(ReadinessService.class).start();
410+
}
411411

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

0 commit comments

Comments
 (0)