Don't swallow cause if Store stats can't be build

This commit is contained in:
Simon Willnauer 2015-08-16 16:36:07 +02:00
parent 5699492575
commit 5ab0833990
2 changed files with 2 additions and 2 deletions

View File

@ -1487,7 +1487,7 @@ public class Store extends AbstractIndexShardComponent implements Closeable, Ref
try {
return new StoreStats(estimateSize(directory), directoryService.throttleTimeInNanos());
} catch (IOException ex) {
throw new ElasticsearchException("failed to refresh store stats");
throw new ElasticsearchException("failed to refresh store stats", ex);
}
}

View File

@ -306,7 +306,7 @@ public class IndexShardTests extends ESSingleNodeTestCase {
assertBusy(new Runnable() { // should be very very quick
@Override
public void run() {
IndexStats indexStats = client().admin().indices().prepareStats("test").get().getIndex("test");
IndexStats indexStats = client().admin().indices().prepareStats("test").clear().get().getIndex("test");
assertNotNull(indexStats.getShards()[0].getCommitStats().getUserData().get(Engine.SYNC_COMMIT_ID));
}
});