ProgressTracker: Decrease delay due nearestAllowed 38/60438/2
authorVratko Polak <>
Fri, 7 Jul 2017 11:14:57 +0000 (13:14 +0200)
committerRobert Varga <>
Mon, 17 Jul 2017 08:06:56 +0000 (08:06 +0000)
If nearestAllowed is in past, that means we have
a temporary interval of relatively small demand for tasks.
We can reduce delay, as if the time since nearestAllowed
was a "delay in advance".

This way the queue stays closer to the intended capacity.

Change-Id: I40f95ea9cb25ea62d8c65ee78cafc79e9b56cc11
Signed-off-by: Vratko Polak <>
(cherry picked from commit 80e6514d56cd4dc6aa40997dea2b460723148341)


index 699c102..027b35d 100644 (file)
@@ -219,7 +219,7 @@ abstract class ProgressTracker {
      * @return estimated tick number when all threads with opened tasks are done waiting
     public long estimateAllowed(final long now) {
-        return Math.max(now, nearestAllowed) + estimateIsolatedDelay(now);
+        return Math.max(now, nearestAllowed + estimateIsolatedDelay(now));
     // State-altering public methods.

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.