diff --git a/doc/connection-backoff.md b/doc/connection-backoff.md index 85cd5e258ed..0e83d9b97f1 100644 --- a/doc/connection-backoff.md +++ b/doc/connection-backoff.md @@ -26,8 +26,9 @@ ConnectWithBackoff() != SUCCESS) SleepUntil(current_deadline) current_backoff = Min(current_backoff * MULTIPLIER, MAX_BACKOFF) - jitter = UniformRandom(-JITTER * current_backoff, JITTER * current_backoff) - current_deadline = now() + Min(current_backoff + jitter, MAX_BACKOFF) + current_deadline = now() + current_backoff + + UniformRandom(-JITTER * current_backoff, JITTER * current_backoff) + ``` With specific parameters of diff --git a/src/core/lib/backoff/backoff.cc b/src/core/lib/backoff/backoff.cc index 5553e6b3f34..500b3d6a8a3 100644 --- a/src/core/lib/backoff/backoff.cc +++ b/src/core/lib/backoff/backoff.cc @@ -59,8 +59,7 @@ grpc_millis BackOff::Step(grpc_exec_ctx* exec_ctx) { const double jitter = generate_uniform_random_number_between( &rng_state_, -options_.jitter() * current_backoff_, options_.jitter() * current_backoff_); - const grpc_millis next_timeout = std::min( - (grpc_millis)(current_backoff_ + jitter), options_.max_backoff()); + const grpc_millis next_timeout = (grpc_millis)(current_backoff_ + jitter); return next_timeout + grpc_exec_ctx_now(exec_ctx); }