diff --git a/core/src/main/java/org/elasticsearch/index/shard/IndexShard.java b/core/src/main/java/org/elasticsearch/index/shard/IndexShard.java index 9ebbde77c6a..f20f2f5d372 100644 --- a/core/src/main/java/org/elasticsearch/index/shard/IndexShard.java +++ b/core/src/main/java/org/elasticsearch/index/shard/IndexShard.java @@ -1286,6 +1286,10 @@ public class IndexShard extends AbstractIndexShardComponent implements IndicesCl if (store.tryIncRef()) { try { cancellableThreads.executeIO(this::doCheckIndex); + } catch (ClosedByInterruptException ex) { + assert cancellableThreads.isCancelled(); + // that's fine we might run into this when we cancel the thread since Java NIO will close the channel on interrupt + // and on the next access we fail it. } finally { store.decRef(); }