Uh oh!
There was an error while loading. Please reload this page.
Implement backoff and jitter timeout by spec RTB1 - #852
Conversation
Add test for TimerUtil range test
Improve test for TimerUtilsTest
owenpearson
left a comment
There was a problem hiding this comment.
The implementation looks correct to me, I've left a couple of minor comments. I would also strongly consider using Random with a seed for testing if possible, that will give you a much cleaner and more predictable way of testing this.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ikbalkaya
left a comment
There was a problem hiding this comment.
I have not carefully checked spec against this change and I just generally went through code which looks good to me
| for (int i = 0; i < retryValues.size(); i++) { | ||
| long retryTime = retryValues.get(i); | ||
| long higherRange = disconnectedRetryTimeout + Math.min(i, 3) * 50L; | ||
| double lowerRange = 0.6 * disconnectedRetryTimeout + Math.min(i, 3) * 50L; |
There was a problem hiding this comment.
change to
double lowerRange = 0.8 * (disconnectedRetryTimeout + Math.min(i, 3) * 50L);
| int defaultTimerMs = 150; | ||
| int timerMs = TimerUtil.getRetryTime(defaultTimerMs, i); | ||
| long higherRange = defaultTimerMs + Math.min(i, 3) * 50L; | ||
| double lowerRange = 0.3 * defaultTimerMs + Math.min(i, 3) * 50L; |
There was a problem hiding this comment.
change to
double lowerRange = 0.8 * (defaultTimerMs + Math.min(i, 3) * 50L);
No description provided.