Catch ClosedByInterruptException when interrupting check index

This commit is contained in:
Simon Willnauer 2016-06-20 14:37:13 +02:00
parent 93415d4506
commit 5746d96f42
1 changed files with 4 additions and 0 deletions

View File

@ -1286,6 +1286,10 @@ public class IndexShard extends AbstractIndexShardComponent implements IndicesCl
if (store.tryIncRef()) { if (store.tryIncRef()) {
try { try {
cancellableThreads.executeIO(this::doCheckIndex); 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 { } finally {
store.decRef(); store.decRef();
} }