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
This commit is contained in:
Lee Hinman 2017-09-06 15:34:51 -06:00
parent 9c795bd838
commit fe02350e73
1 changed files with 1 additions and 1 deletions

View File

@ -225,7 +225,7 @@ public final class QueueResizingEsThreadPoolExecutor extends EsThreadPoolExecuto
// - Since taskCount will now be incremented forever, it will never be 10 again,
// so there will be no further adjustments
logger.debug("[{}]: too many incoming tasks while queue size adjustment occurs, resetting measurements to 0", name);
totalTaskNanos.getAndSet(0);
totalTaskNanos.getAndSet(1);
taskCount.getAndSet(0);
startNs = System.nanoTime();
} else {