Don't track more than 10 failures and make sure delay has a minimum
@@ -165,6 +165,7 @@ public class JRTConfigRequester implements RequestWaiter {
log.log(INFO, "Failure of config subscription to " + connection.getAddress() +
", clients will keep existing config until resolved: " + sub);
connectionPool.switchConnection(connection);
+ if (failures < 10)
failures++;
long delay = calculateFailedRequestDelay(failures, timingValues);
// The logging depends on whether we are configured or not.
@@ -177,7 +178,7 @@ public class JRTConfigRequester implements RequestWaiter {
static long calculateFailedRequestDelay(int failures, TimingValues timingValues) {
long delay = timingValues.getFixedDelay() * (long)Math.pow(2, failures);
- delay = Math.min(60_000, delay);
+ delay = Math.max(timingValues.getFixedDelay(), Math.min(60_000, delay)); // between timingValues.getFixedDelay() and 60 seconds
delay = timingValues.getPlusMinusFractionRandom(delay, randomFraction);
return delay;
