google-cloud-java icon indicating copy to clipboard operation
google-cloud-java copied to clipboard

Update Jitter in Exponential Retry Strategy

Open frankyn opened this issue 5 years ago • 0 comments

Is your feature request related to a problem? Please describe. In Exponential Retry Strategy, Jitter is used to prevent from several clients retrying at the same time. However, the existing jitter value is generated per:

actualDelay = rand_between(0, min(maxRetryDelay, exponentialDelay))

The issue with the delay is with pathological case of a short delay, e.g. 1 second.

Describe the solution you'd like It would help to update jitter delay to be either one of the following:

  1. actualDelay = exponentialDelay + rand_milliseconds()
  2. actualDelay = rand_between(exponentialDelay - E, exponentialDelay + E) where E is constant value used to create a range with respect to exponentialDelay.

Describe alternatives you've considered Turning off jitter which defeats the purpose of having jitter.

First came up in: https://github.com/googleapis/java-storage/issues/178

frankyn avatar Oct 27 '20 20:10 frankyn