Handle AlreadyClosedException when bumping primary term
If the shard is already closed while bumping the primary term, this can result in an AlreadyClosedException to be thrown. As we use asyncBlockOperations, the exception will be thrown on a thread from the generic thread pool and end up in the uncaught exception handler, failing our tests. Relates to #32442
This commit is contained in:
parent
66edba2012
commit
3cf08326ab
|
@ -2229,7 +2229,13 @@ public class IndexShard extends AbstractIndexShardComponent implements IndicesCl
|
|||
onBlocked.run();
|
||||
}
|
||||
},
|
||||
e -> failShard("exception during primary term transition", e));
|
||||
e -> {
|
||||
try {
|
||||
failShard("exception during primary term transition", e);
|
||||
} catch (AlreadyClosedException ace) {
|
||||
// ignore, shard is already closed
|
||||
}
|
||||
});
|
||||
pendingPrimaryTerm = newPrimaryTerm;
|
||||
termUpdated.countDown();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue