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

Add support for new retry modes #1972

Merged
merged 4 commits into from
Feb 14, 2020
Merged

Conversation

jamesls
Copy link
Member

@jamesls jamesls commented Feb 13, 2020

Add support for parsing retryable metadata in model

Add support for retries v2 standard mode

This adds the concept of "retry modes" which allows us to
introduce different retry behavior.

The default mode, legacy, is the existing retry behavior.
This means that new retry modes (in v1) require an opt-in.

The new standard mode moves away from the _retry.json and
contains a set of errors that are retried that is now consistent
with other AWS SDKs implementing standard mode. This mode also
adds support for retry quotas which control how many unsuccessful
retries a client can make.

As part of this change, I've added a new total_max_attempts config
option.

This addresses the fact that there's already a max
attempts client config var in botocore v1, and that it
doesn't mean the same thing as the AWS_MAX_ATTEMPTS
env var. To summarize:

  • The client config's max_attempts remains unchanged.
  • A new total_max_attempts var is added that maps to the
    AWS_MAX_ATTEMPTS and max_attempts env var and config file
    values.
  • We internally convert client config max_attempts to
    total_max_attempts and ensure internally (in args.py and
    client.py) we only use this new value.

Add support for adaptive mode retries

This adds a new experimental retry mode, adaptive, that adds
support for client side rate limiting based on receiving
throttling responses. adaptive mode includes all the behavior
on standard mode.

This adds the concept of "retry modes" which allows us to
introduce different retry behavior.

The default mode, `legacy`, is the existing retry behavior.
This means that new retry modes (in v1) require an opt-in.

The new `standard` mode moves away from the `_retry.json` and
contains a set of errors that are retried that is now consistent
with other AWS SDKs implementing standard mode.  This mode also
adds support for retry quotas which control how many unsuccessful
retries a client can make.

As part of this change, I've added a new total_max_attempts config
option.

This addresses the fact that there's already a max
attempts client config var in botocore v1, and that it
doesn't mean the same thing as the `AWS_MAX_ATTEMPTS`
env var.  To summarize:

* The client config's `max_attemtps` remains unchanged.
* A new `total_max_attempts` var is added that maps to the
  `AWS_MAX_ATTEMPTS` and `max_attempts` env var and config file
  values.
* We internally convert client config `max_attempts` to
  `total_max_attempts` and ensure internally (in args.py and
  client.py) we only use this new value.
This adds a new experimental retry mode, `adaptive`, that adds
support for client side rate limiting based on receiving
throttling responses.  `adaptive` mode includes all the behavior
on `standard` mode.
@codecov-io
Copy link

codecov-io commented Feb 13, 2020

Codecov Report

Merging #1972 into develop will increase coverage by 0.24%.
The diff coverage is 98.17%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1972      +/-   ##
===========================================
+ Coverage    92.73%   92.98%   +0.24%     
===========================================
  Files           53       60       +7     
  Lines        10293    10784     +491     
===========================================
+ Hits          9545    10027     +482     
- Misses         748      757       +9
Impacted Files Coverage Δ
botocore/model.py 98.06% <ø> (ø) ⬆️
botocore/configprovider.py 93.37% <ø> (ø) ⬆️
botocore/args.py 100% <100%> (ø) ⬆️
botocore/retries/base.py 100% <100%> (ø)
botocore/config.py 100% <100%> (ø) ⬆️
botocore/retries/quota.py 100% <100%> (ø)
botocore/retries/throttling.py 100% <100%> (ø)
botocore/exceptions.py 99.43% <100%> (+0.01%) ⬆️
botocore/client.py 98.58% <84.84%> (-1.16%) ⬇️
botocore/retries/special.py 96.42% <96.42%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fa0c243...f6bec32. Read the comment docs.

Copy link
Member

@kyleknap kyleknap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@kyleknap
Copy link
Member

We should also add a changelog entry for the new modes before merging.

jamesls added a commit that referenced this pull request Feb 14, 2020
PR #1972

* v1-new-retries:
  Add changelog entry for new retry feature
  Add support for adaptive mode retries
  Add support for retries v2 standard mode
  Add support for parsing retryable metadata in model
@jamesls jamesls merged commit f6bec32 into boto:develop Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants