Skip to content

Commit

Permalink
Add IndicesMetrics instead of IndicesService to toClose (elastic#114782)
Browse files Browse the repository at this point in the history
The same line already exists in
[L543](https://github.com/ywangd/elasticsearch/blob/9f4a7927bdc366f8ca98c4652ac7d1102d9430f5/server/src/main/java/org/elasticsearch/node/Node.java#L543).
It should have no practial impact since AbstractLifecycleComponent#close
short-circuits if its lifecycle is already closed. The original code
meant to close IndicesMetrics. This PR adds it.

Relates: elastic#113737
  • Loading branch information
ywangd committed Oct 15, 2024
1 parent f273fdc commit afba370
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/src/main/java/org/elasticsearch/node/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ public synchronized void close() throws IOException {
toClose.add(() -> stopWatch.stop().start("transport"));
toClose.add(injector.getInstance(TransportService.class));
toClose.add(injector.getInstance(NodeMetrics.class));
toClose.add(injector.getInstance(IndicesService.class));
toClose.add(injector.getInstance(IndicesMetrics.class));
if (ReadinessService.enabled(environment)) {
toClose.add(injector.getInstance(ReadinessService.class));
}
Expand Down

0 comments on commit afba370

Please sign in to comment.