Skip to content

Commit 876ae78

Browse files
committed
Assert that taskQueueLatency >= 0
1 parent 778e8b5 commit 876ae78

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

server/src/main/java/org/elasticsearch/common/util/concurrent/TaskExecutionTimeTrackingEsThreadPoolExecutor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ protected void beforeExecute(Thread t, Runnable r) {
162162
final TimedRunnable timedRunnable = (TimedRunnable) super.unwrap(r);
163163
timedRunnable.beforeExecute();
164164
final long taskQueueLatency = timedRunnable.getQueueTimeNanos();
165+
assert taskQueueLatency >= 0;
165166
queueLatencyMillisHistogram.addObservation(TimeUnit.NANOSECONDS.toMillis(taskQueueLatency));
166167
}
167168

0 commit comments

Comments
 (0)