Skip to content

Commit a556387

Browse files
authored
Fix NPE in IndexShard flushStats (#130809) (#130995)
Fixes #124164
1 parent 54b46ac commit a556387

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
@@ -1335,11 +1335,12 @@ public RefreshStats refreshStats() {
13351335
}
13361336

13371337
public FlushStats flushStats() {
1338+
final Engine engine = getEngineOrNull();
13381339
return new FlushStats(
13391340
flushMetric.count(),
13401341
periodicFlushMetric.count(),
13411342
TimeUnit.NANOSECONDS.toMillis(flushMetric.sum()),
1342-
getEngineOrNull() != null ? getEngineOrNull().getTotalFlushTimeExcludingWaitingOnLockInMillis() : 0L
1343+
engine != null ? engine.getTotalFlushTimeExcludingWaitingOnLockInMillis() : 0L
13431344
);
13441345
}
13451346

0 commit comments

Comments
 (0)