Allow one extra pending in a fraction of the resize interval
... equal to the fractional part of the window size
please review
@@ -77,7 +77,7 @@ public class DynamicThrottlePolicy extends StaticThrottlePolicy {
}
timeOfLastMessage = time;
int windowSizeFloored = (int) windowSize;
- boolean carry = numSent / (windowSize * resizeRate) < windowSize - windowSizeFloored;
+ boolean carry = numSent < (windowSize * resizeRate) * windowSize - windowSizeFloored;
return pendingCount < windowSizeFloored + (carry ? 1 : 0);
}
