Skip to content

Commit 3e5e367

Browse files
Fix Tripped Assertion on Resync during Node Shutdown (elastic#71062) (elastic#71100)
We can have a race here where the closed check passes and then we concurrently to a shard close try to fail the shard also. Previously this was covered by the catch below the changed code that would just ignore the already-closed exception but with elastic#69949 we're now forking to the generic pool for this logic and thus have to handle the exception in the callback as well.
1 parent d8125bd commit 3e5e367

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/src/main/java/org/elasticsearch/index/shard/IndexShard.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,11 @@ public void onFailure(Exception e) {
592592
if (state == IndexShardState.CLOSED) {
593593
// ignore, shutting down
594594
} else {
595-
failShard("exception during primary-replica resync", e);
595+
try {
596+
failShard("exception during primary-replica resync", e);
597+
} catch (AlreadyClosedException ace) {
598+
// okay, the index was deleted
599+
}
596600
}
597601
}
598602
});

0 commit comments

Comments
 (0)