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

Fix a timing issue in the waiters retry delay calculation #2259

Merged
merged 1 commit into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/source-1.0/spec/waiters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,12 @@ exponential backoff with jitter through the following algorithm:
delay = random(minDelay, delay)

if remainingTime - delay <= minDelay:
delay = remainingTime - minDelay
delay = remainingTime

If the computed ``delay`` subtracted from ``remainingTime`` is less than
or equal to ``minDelay``, then set ``delay`` to ``remainingTime`` minus
``minDelay`` and perform one last retry. This prevents a waiter from waiting
needlessly only to exceed ``maxWaitTime`` before issuing a final request.
or equal to ``minDelay``, then set ``delay`` to ``remainingTime`` and
perform one last retry. This prevents a waiter from waiting needlessly
only to exceed ``maxWaitTime`` before issuing a final request.

Using the default ``minDelay`` of 2, the default ``maxDelay`` of 120, a caller
provided ``maxWaitTime`` of 300 (5 minutes), and assuming that requests
Expand Down
12 changes: 6 additions & 6 deletions docs/source-2.0/additional-specs/waiters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ exponential backoff with jitter through the following algorithm:
delay = random(minDelay, delay)

if remainingTime - delay <= minDelay:
delay = remainingTime - minDelay
delay = remainingTime

If the computed ``delay`` subtracted from ``remainingTime`` is less than
or equal to ``minDelay``, then set ``delay`` to ``remainingTime`` minus
``minDelay`` and perform one last retry. This prevents a waiter from waiting
needlessly only to exceed ``maxWaitTime`` before issuing a final request.
or equal to ``minDelay``, then set ``delay`` to ``remainingTime`` and
perform one last retry. This prevents a waiter from waiting needlessly
only to exceed ``maxWaitTime`` before issuing a final request.

Using the default ``minDelay`` of 2, the default ``maxDelay`` of 120, a caller
provided ``maxWaitTime`` of 300 (5 minutes), and assuming that requests
Expand Down Expand Up @@ -259,8 +259,8 @@ follows:
- 296
- 4
* - 13 (last attempt)
- 2
- 298
- 4
- 300
- N/A

.. note::
Expand Down
Loading