Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick #10177 to 6.x: common.Backoff now implements jitter instead of sleeping for a fixed amount of time #10229

Merged
merged 1 commit into from
Jan 23, 2019

Commits on Jan 21, 2019

  1. common.Backoff now implements jitter instead of sleeping for a fixed …

    …amount of time (elastic#10177)
    
    This PR add a new interface called backoff.Backoff, this can be used to
    generalize any backoff interaction. It move the current Backoff strategy
    under an ExpBackoff type.
    
    ExpBackoff is the same as before on every wait we just
    exponentially increase the duration of the wait and sleep for that
    amount.
    
    EqualJitterBackoff uses an exponential increment of the duration but
    will take half of that value as fixed sleep time and the other half
    as a jitter. This will help distribute the new request when a cluster is
    done instead of having all the beats trying to reconnect at once.
    
    The Redis implementations and any clients wrapped with a backoff will
    now use the EqualJitterBackoff, any other code will keep using the same
    exponential strategy.
    
    Fixes: elastic#10172
    (cherry picked from commit 4cb9bd7)
    ph committed Jan 21, 2019
    Configuration menu
    Copy the full SHA
    7ef2589 View commit details
    Browse the repository at this point in the history