}
try {
latch.await();
} catch (InterruptedException e) {
throw new IOExceptionWithCause(
"Wait for background indexing tasks was interrupted", e);
} finally {
invalidateSharedReader();
}
if (!exceptions.isEmpty()) {
throw new IOExceptionWithCause(
exceptions.size() + " of " + docs.length
+ " background indexer tasks failed", exceptions.get(0));
}
}