diff options
author | Bjørn Christian Seime <bjorncs@yahooinc.com> | 2023-05-02 16:06:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-02 16:06:16 +0200 |
commit | f4feadceacdce08fd73b40e76ada7f33512126c3 (patch) | |
tree | 3d8848f0ad9bd8d48c0d848195e6779050714353 /jdisc_core/src/main/java/com/yahoo/jdisc/core/ScheduledQueue.java | |
parent | 924b8368f9fc7034825db0db66559ba268f33020 (diff) | |
parent | b34f0750f733bf7012b99db3cc5f82b154ea87a6 (diff) |
Merge pull request #26940 from vespa-engine/balder/always-prioritize-timing-out-request
If you start lagging behind, always prefer timing out as that will be…
Diffstat (limited to 'jdisc_core/src/main/java/com/yahoo/jdisc/core/ScheduledQueue.java')
-rw-r--r-- | jdisc_core/src/main/java/com/yahoo/jdisc/core/ScheduledQueue.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/core/ScheduledQueue.java b/jdisc_core/src/main/java/com/yahoo/jdisc/core/ScheduledQueue.java index 09483a7c7e5..881ccebdb93 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/core/ScheduledQueue.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/core/ScheduledQueue.java @@ -12,7 +12,6 @@ class ScheduledQueue { public static final int MILLIS_PER_SLOT = 100; public static final int NUM_SLOTS = 512; - public static final int NUM_SLOTS_UNDILATED = 3; public static final int SLOT_MASK = 511; // bitmask to modulo NUM_SLOTS public static final int ITER_SHIFT = 9; // number of bits to shift off SLOT_MASK @@ -38,13 +37,11 @@ class ScheduledQueue { int queueSize = queueSize() + out.size(); drainTo(NUM_SLOTS, 0, out); for (int i = 0; currentTimeMillis >= nextTick && (queueSize > out.size()); i++, nextTick += MILLIS_PER_SLOT) { - if (i < NUM_SLOTS_UNDILATED) { - if (++currSlot >= NUM_SLOTS) { - currSlot = 0; - currIter++; - } - drainTo(currSlot, currIter, out); + if (++currSlot >= NUM_SLOTS) { + currSlot = 0; + currIter++; } + drainTo(currSlot, currIter, out); } } |