File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
server/src/main/java/org/elasticsearch/index Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -245,11 +245,12 @@ protected final DocsStats docsStats(IndexReader indexReader) {
245245 return new DocsStats (numDocs , numDeletedDocs , sizeInBytes );
246246 }
247247
248+ /**
249+ * @throws AlreadyClosedException if the shard is closed
250+ */
248251 public ShardFieldStats getShardFieldStats () {
249252 try (var searcher = acquireSearcher ("shard_field_stats" , Engine .SearcherScope .INTERNAL )) {
250253 return getShardFieldStats (searcher .getLeafContexts ());
251- } catch (AlreadyClosedException ignored ) {
252- return null ;
253254 }
254255 }
255256
Original file line number Diff line number Diff line change @@ -4140,7 +4140,9 @@ public void beforeRefresh() {
41404140 @ Override
41414141 public void afterRefresh (boolean didRefresh ) {
41424142 if (shardFieldStats == null || didRefresh ) {
4143- shardFieldStats = getEngine ().getShardFieldStats ();
4143+ try {
4144+ shardFieldStats = getEngine ().getShardFieldStats ();
4145+ } catch (AlreadyClosedException ignored ) {}
41444146 }
41454147 }
41464148 }
You can’t perform that action at this time.
0 commit comments