소스 검색

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

Simon Willnauer 10 년 전
부모
커밋
5ab0833990

+ 1 - 1
core/src/main/java/org/elasticsearch/index/store/Store.java

@@ -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);
             }
         }
 

+ 1 - 1
core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java

@@ -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));
             }
         });