Skip to content

Commit d6f91f5

Browse files
authored
Fix NPE in IndexShard flushStats (#130809) (#130993)
Fixes #124164
1 parent 46ec95b commit d6f91f5

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
@@ -1340,11 +1340,12 @@ public RefreshStats refreshStats() {
13401340
}
13411341

13421342
public FlushStats flushStats() {
1343+
final Engine engine = getEngineOrNull();
13431344
return new FlushStats(
13441345
flushMetric.count(),
13451346
periodicFlushMetric.count(),
13461347
TimeUnit.NANOSECONDS.toMillis(flushMetric.sum()),
1347-
getEngineOrNull() != null ? getEngineOrNull().getTotalFlushTimeExcludingWaitingOnLockInMillis() : 0L
1348+
engine != null ? engine.getTotalFlushTimeExcludingWaitingOnLockInMillis() : 0L
13481349
);
13491350
}
13501351

0 commit comments

Comments
 (0)