You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Problem
`equalJittered` is a strange Backoff policy:
- the first duration is not jittered;
- it's actually exponential, but we already have `exponentialJittered` policy;
- its' name - `equal` - does not tell much (to me);
- scaladoc says it "keeps half of the exponential growth", it's not clear what's meant by "half": it multiplies the original `startDuration` by 2 each time, similar to `exponentialJittered` policy;
- scaladoc says it has "jitter between 0 and that amount", which can be confusing, because the jitter is between the current and the next duration;
- it's hard to explain where `equalJittered` should be used instead of `exponentialJittered` and vice versa, they are very similar;
# Solution
Remove `equalJittered`, fallback to `exponentialJittered`.
JIRA Issues: STOR-8883
Differential Revision: https://phabricator.twitter.biz/D1182535
/**@see [[Backoff.exponentialJittered]] as the api to create this strategy. */
315
265
// exposed for testing
316
266
private[finagle] finalclassExponentialJittered(
@@ -427,14 +377,12 @@ object Backoff {
427
377
* - Create backoffs that grow linearly, can be created via `Backoff.linear`.
428
378
* 1. DecorrelatedJittered
429
379
* - Create backoffs that jitter randomly between a start value and 3 times of that value, can be created via `Backoff.decorrelatedJittered`.
430
-
* 1. EqualJittered
431
-
* - Create backoffs that jitter between 0 and half of the exponential growth. Can be created via `Backoff.equalJittered`.
432
380
* 1. ExponentialJittered
433
381
* - Create backoffs that jitter randomly between value/2 and value+value/2 that grows exponentially by 2. Can be created via `Backoff.exponentialJittered`.
434
382
*
435
383
* @note A new [[Backoff]] will be created only when `next` is called.
436
384
* @note None of the [[Backoff]]s are memoized, for strategies that involve
437
-
* randomness (`DecorrelatedJittered`, `EqualJittered` and
385
+
* randomness (`DecorrelatedJittered` and
438
386
* `ExponentialJittered`), there is no way to foresee the next backoff
439
387
* value.
440
388
* @note All [[Backoff]]s are infinite unless using [[take(Int)]] to create a
0 commit comments