Skip to content

Commit

Permalink
Fix NPE in ClusterInfoService (#65654) (#65657)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
original-brownbear authored Dec 1, 2020
1 parent 1a5a675 commit 7c34d70
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ static void buildShardLevelInfo(Logger logger, ShardStats[] stats, ImmutableOpen
newShardRoutingToDataPath.put(shardRouting, s.getDataPath());

final StoreStats storeStats = s.getStats().getStore();
if (storeStats == null) {
continue;
}
final long size = storeStats.sizeInBytes();
final long reserved = storeStats.getReservedSize().getBytes();

Expand Down

0 comments on commit 7c34d70

Please sign in to comment.