Skip to content

Commit 8e29403

Browse files
authored
Fix NPE in IndexShard flushStats (#130809) (#130992)
Fixes #124164
1 parent d007ad0 commit 8e29403

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
@@ -1366,11 +1366,12 @@ public RefreshStats refreshStats() {
13661366
}
13671367

13681368
public FlushStats flushStats() {
1369+
final Engine engine = getEngineOrNull();
13691370
return new FlushStats(
13701371
flushMetric.count(),
13711372
periodicFlushMetric.count(),
13721373
TimeUnit.NANOSECONDS.toMillis(flushMetric.sum()),
1373-
getEngineOrNull() != null ? getEngineOrNull().getTotalFlushTimeExcludingWaitingOnLockInMillis() : 0L
1374+
engine != null ? engine.getTotalFlushTimeExcludingWaitingOnLockInMillis() : 0L
13741375
);
13751376
}
13761377

0 commit comments

Comments
 (0)