Skip to content

Commit c20bf75

Browse files
committed
assert IOE
1 parent 437c8ea commit c20bf75

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache

x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/CacheService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.elasticsearch.index.store.cache.CacheKey;
2929
import org.elasticsearch.threadpool.ThreadPool;
3030

31+
import java.io.IOException;
3132
import java.nio.file.Files;
3233
import java.nio.file.Path;
3334
import java.util.HashSet;
@@ -268,13 +269,15 @@ protected void synchronizeCache() {
268269
IOUtils.fsync(cacheDir, true, false);
269270
logger.trace("cache directory [{}] synchronized", cacheDir);
270271
} catch (Exception e) {
272+
assert e instanceof IOException : e;
271273
logger.warn(() -> new ParameterizedMessage("failed to synchronize cache directory [{}]", cacheDir), e);
272274
}
273275
}
274276
// TODO Index searchable snapshot shard information + cache file ranges in Lucene
275277
count += 1L;
276278
}
277279
} catch (Exception e) {
280+
assert e instanceof IOException : e;
278281
logger.warn(() -> new ParameterizedMessage("failed to fsync cache file [{}]", cacheFilePath.getFileName()), e);
279282
}
280283
}

0 commit comments

Comments
 (0)