Skip to content

Commit 0db32f7

Browse files
committed
With too many incoming tasks, reset measurements to 1ns instead of 0ns
Resoves #26332 where too many tasks occurred while adjustment was happening, the measurements were reset to 0, and then an assert failed due to tasks executing in 0 nanoseconds
1 parent 30950e7 commit 0db32f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/org/elasticsearch/common/util/concurrent/QueueResizingEsThreadPoolExecutor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ protected void afterExecute(Runnable r, Throwable t) {
225225
// - Since taskCount will now be incremented forever, it will never be 10 again,
226226
// so there will be no further adjustments
227227
logger.debug("[{}]: too many incoming tasks while queue size adjustment occurs, resetting measurements to 0", name);
228-
totalTaskNanos.getAndSet(0);
228+
totalTaskNanos.getAndSet(1);
229229
taskCount.getAndSet(0);
230230
startNs = System.nanoTime();
231231
} else {

0 commit comments

Comments
 (0)