diff options
author | David Klempner <klempner@google.com> | 2015-07-13 18:02:06 -0700 |
---|---|---|
committer | David Klempner <klempner@google.com> | 2015-07-13 18:02:06 -0700 |
commit | e00b0c3247e94fa98ae8e00641598853caedcd1c (patch) | |
tree | 079288da05024dceefdbb6a7b8fbf60ddc754dea /doc/connection-backoff.md | |
parent | ca5add658a8bb80f3a4ffc20af58fd2a19b69eac (diff) |
Add description of MIN_CONNECT_TIMEOUT and fix its pseudocode usage.
Diffstat (limited to 'doc/connection-backoff.md')
-rw-r--r-- | doc/connection-backoff.md | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/doc/connection-backoff.md b/doc/connection-backoff.md index 70abc980f0..7094e737c5 100644 --- a/doc/connection-backoff.md +++ b/doc/connection-backoff.md @@ -8,8 +8,9 @@ requests) and instead do some form of exponential backoff. We have several parameters: 1. INITIAL_BACKOFF (how long to wait after the first failure before retrying) 2. MULTIPLIER (factor with which to multiply backoff after a failed retry) - 3. MAX_BACKOFF (Upper bound on backoff) - 4. MIN_CONNECTION_TIMEOUT + 3. MAX_BACKOFF (upper bound on backoff) + 4. MIN_CONNECT_TIMEOUT (minimum time we're willing to give a connection to + complete) ## Proposed Backoff Algorithm @@ -20,7 +21,7 @@ MAX_BACKOFF, with jitter. ConnectWithBackoff() current_backoff = INITIAL_BACKOFF current_deadline = now() + INITIAL_BACKOFF - while (TryConnect(Max(current_deadline, MIN_CONNECT_TIMEOUT)) + while (TryConnect(Max(current_deadline, now() + MIN_CONNECT_TIMEOUT)) != SUCCESS) SleepUntil(current_deadline) current_backoff = Min(current_backoff * MULTIPLIER, MAX_BACKOFF) |