Skip to content

Commit f8f08ba

Browse files
Fix NPE in ClusterInfoService (#65654) (#65659)
Store stats can be `null` if e.g. the shard was already closed when the stats where retrieved. Don't record those shards in the sizes map to fix an NPE in this case.
1 parent 16642f1 commit f8f08ba

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

server/src/main/java/org/elasticsearch/cluster/InternalClusterInfoService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,9 @@ static void buildShardLevelInfo(Logger logger, ShardStats[] stats, ImmutableOpen
331331
newShardRoutingToDataPath.put(shardRouting, s.getDataPath());
332332

333333
final StoreStats storeStats = s.getStats().getStore();
334+
if (storeStats == null) {
335+
continue;
336+
}
334337
final long size = storeStats.sizeInBytes();
335338
final long reserved = storeStats.getReservedSize().getBytes();
336339

0 commit comments

Comments
 (0)