Skip to content

Commit

Permalink
Close RemoteStorePinnedTimestampService on Node.close() (#16228)
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Kale <[email protected]>
(cherry picked from commit 96082f7)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Oct 8, 2024
1 parent ad97686 commit d688f9b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/src/main/java/org/opensearch/node/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -1862,6 +1862,7 @@ public synchronized void close() throws IOException {
toClose.add(() -> stopWatch.stop().start("transport"));
toClose.add(injector.getInstance(TransportService.class));
toClose.add(nodeService.getTaskCancellationMonitoringService());
toClose.add(injector.getInstance(RemoteStorePinnedTimestampService.class));

for (LifecycleComponent plugin : pluginLifecycleComponents) {
toClose.add(() -> stopWatch.stop().start("plugin(" + plugin.getClass().getName() + ")"));
Expand Down Expand Up @@ -1892,6 +1893,7 @@ public synchronized void close() throws IOException {
if (logger.isTraceEnabled()) {
toClose.add(() -> logger.trace("Close times for each service:\n{}", stopWatch.prettyPrint()));
}

IOUtils.close(toClose);
logger.info("closed");
}
Expand Down

0 comments on commit d688f9b

Please sign in to comment.