From 4da8f08c63af789ea3ac31cf288aeae4381919a8 Mon Sep 17 00:00:00 2001 From: Dawid Weiss Date: Wed, 20 Jan 2021 19:05:22 +0100 Subject: [PATCH] LUCENE-9683: fix incorrect logic for measuring stall time information. (#2225) --- .../org/apache/lucene/index/ConcurrentMergeScheduler.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java b/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java index 34c9a741904..cfa5d11519f 100644 --- a/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java +++ b/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java @@ -598,10 +598,12 @@ public class ConcurrentMergeScheduler extends MergeScheduler { return false; } - if (verbose() && startStallTime == 0) { - message(" too many merges; stalling..."); + if (startStallTime == 0) { + startStallTime = System.currentTimeMillis(); + if (verbose()) { + message(" too many merges; stalling..."); + } } - startStallTime = System.currentTimeMillis(); doStall(); }