Skip to content

Commit 79cb0ea

Browse files
committed
better close logic for concurrent recovery streams
1 parent 08ecd9d commit 79cb0ea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/org/elasticsearch/indices/recovery/RecoverySettings.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ public RecoverySettings(Settings settings, NodeSettingsService nodeSettingsServi
8585

8686
public void close() {
8787
concurrentStreamPool.shutdown();
88+
try {
89+
concurrentStreamPool.awaitTermination(1, TimeUnit.SECONDS);
90+
} catch (InterruptedException e) {
91+
// that's fine...
92+
}
93+
concurrentStreamPool.shutdownNow();
8894
}
8995

9096
public ByteSizeValue fileChunkSize() {

0 commit comments

Comments
 (0)