Skip to content

Commit

Permalink
Fix Tripped Assertion on Resync during Node Shutdown (#71062)
Browse files Browse the repository at this point in the history
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 #69949 we're
now forking to the generic pool for this logic and thus have to handle the exception in the
callback as well.
  • Loading branch information
original-brownbear authored Mar 31, 2021
1 parent 8537b2d commit 5db1673
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,11 @@ public void onFailure(Exception e) {
if (state == IndexShardState.CLOSED) {
// ignore, shutting down
} else {
failShard("exception during primary-replica resync", e);
try {
failShard("exception during primary-replica resync", e);
} catch (AlreadyClosedException ace) {
// okay, the index was deleted
}
}
}
});
Expand Down

0 comments on commit 5db1673

Please sign in to comment.