Skip to content

Commit b2cdfc4

Browse files
committed
Fix NPE in IndexShard flushStats (#130809)
Fixes #124164
1 parent 0577608 commit b2cdfc4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/src/main/java/org/elasticsearch/index/shard/IndexShard.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1344,11 +1344,12 @@ public RefreshStats refreshStats() {
13441344
}
13451345

13461346
public FlushStats flushStats() {
1347+
final Engine engine = getEngineOrNull();
13471348
return new FlushStats(
13481349
flushMetric.count(),
13491350
periodicFlushMetric.count(),
13501351
TimeUnit.NANOSECONDS.toMillis(flushMetric.sum()),
1351-
getEngineOrNull() != null ? getEngineOrNull().getTotalFlushTimeExcludingWaitingOnLockInMillis() : 0L
1352+
engine != null ? engine.getTotalFlushTimeExcludingWaitingOnLockInMillis() : 0L
13521353
);
13531354
}
13541355

0 commit comments

Comments
 (0)