mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-24 22:09:24 +00:00
Ensure total nanosecond time for tasks is at least 1 nanosecond
In rare cases the total nanoseconds for an entire window of operations can be 0 nanoseconds, causing the assertion in QueueResizingEsThreadPoolExecutor.calculateLambda to trip. This ensures that we calculate the lambda value with at least 1 nanosecond. Resolves #27607
This commit is contained in:
parent
be74f11517
commit
c25a4637e8
@ -167,7 +167,7 @@ public final class QueueResizingEsThreadPoolExecutor extends EsThreadPoolExecuto
|
||||
|
||||
// Calculate the new desired queue size
|
||||
try {
|
||||
final double lambda = calculateLambda(tasksPerFrame, totalNanos);
|
||||
final double lambda = calculateLambda(tasksPerFrame, Math.max(totalNanos, 1L));
|
||||
final int desiredQueueSize = calculateL(lambda, targetedResponseTimeNanos);
|
||||
final int oldCapacity = workQueue.capacity();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user