diff options
3 files changed, 15 insertions, 4 deletions
diff --git a/container-messagebus/src/main/java/com/yahoo/container/jdisc/messagebus/SessionCache.java b/container-messagebus/src/main/java/com/yahoo/container/jdisc/messagebus/SessionCache.java index 7f67f7ec403..d65b2f7cc12 100644 --- a/container-messagebus/src/main/java/com/yahoo/container/jdisc/messagebus/SessionCache.java +++ b/container-messagebus/src/main/java/com/yahoo/container/jdisc/messagebus/SessionCache.java @@ -37,6 +37,7 @@ import java.util.logging.Logger; * @author Steinar Knutsen * @author Einar Rosenvinge */ +// TODO jonmv: Remove this? Only used sensibly by FeedHandlerV3, where only timeout varies. public final class SessionCache extends AbstractComponent { private static final Logger log = Logger.getLogger(SessionCache.class.getName()); diff --git a/messagebus/src/main/java/com/yahoo/messagebus/DynamicThrottlePolicy.java b/messagebus/src/main/java/com/yahoo/messagebus/DynamicThrottlePolicy.java index ab09c9f5720..9aa7529cd8b 100644 --- a/messagebus/src/main/java/com/yahoo/messagebus/DynamicThrottlePolicy.java +++ b/messagebus/src/main/java/com/yahoo/messagebus/DynamicThrottlePolicy.java @@ -105,11 +105,11 @@ public class DynamicThrottlePolicy extends StaticThrottlePolicy { long time = timer.milliTime(); double elapsed = (time - timeOfLastMessage); if (elapsed > IDLE_TIME_MILLIS) { - windowSize = Math.min(windowSize, pendingCount + windowSizeIncrement); + windowSize = Math.max(minWindowSize, Math.min(windowSize, pendingCount + windowSizeIncrement)); } timeOfLastMessage = time; int windowSizeFloored = (int) windowSize; - // Use floating point window sizes, so the algorithm sees the different in 1.1 and 1.9 window size. + // Use floating point window sizes, so the algorithm sees the difference between 1.1 and 1.9 window size. boolean carry = numSent < (windowSize * resizeRate) * (windowSize - windowSizeFloored); return pendingCount < windowSizeFloored + (carry ? 1 : 0); } @@ -257,6 +257,9 @@ public class DynamicThrottlePolicy extends StaticThrottlePolicy { * @return this, to allow chaining */ public DynamicThrottlePolicy setMaxWindowSize(double max) { + if (max < 1) + throw new IllegalArgumentException("Maximum window size cannot be less than one"); + this.maxWindowSize = max; return this; } @@ -279,6 +282,9 @@ public class DynamicThrottlePolicy extends StaticThrottlePolicy { * @return this, to allow chaining */ public DynamicThrottlePolicy setMinWindowSize(double min) { + if (min < 1) + throw new IllegalArgumentException("Minimum window size cannot be less than one"); + this.minWindowSize = min; this.windowSize = Math.max(this.minWindowSize, this.windowSizeIncrement); return this; diff --git a/yolean/src/main/java/com/yahoo/yolean/system/CatchSignals.java b/yolean/src/main/java/com/yahoo/yolean/system/CatchSignals.java index dce70fbbb5f..3f0d6f3fbdd 100644 --- a/yolean/src/main/java/com/yahoo/yolean/system/CatchSignals.java +++ b/yolean/src/main/java/com/yahoo/yolean/system/CatchSignals.java @@ -1,12 +1,16 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.yolean.system; -import java.lang.reflect.*; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; +import java.util.concurrent.atomic.AtomicBoolean; // import sun.misc.Signal; // import sun.misc.SignalHandler; -import java.util.concurrent.atomic.AtomicBoolean; public class CatchSignals { /** |