Skip to content

[SDK-2686] Add retry on rate limit errors for management API#368

Merged
jimmyjames merged 1 commit intomasterfrom
rate-limit-retry
Aug 19, 2021
Merged

[SDK-2686] Add retry on rate limit errors for management API#368
jimmyjames merged 1 commit intomasterfrom
rate-limit-retry

Conversation

@jimmyjames
Copy link
Copy Markdown
Contributor

Changes

This change adds the ability to retry requests to the Management API that fail due to a rate-limit (429) error. It does so through a new OkHttp Interceptor and the failsafe library.

Details:

  • By default, 429 responses are retried three times
  • The maximum retries are configurable, between zero and ten. A value of zero results in no retries.
  • Retries are configured with an initial delay of 100ms, using an exponential backoff, up to a maximum of 1 second. A jitter factor of 0.2 is applied.
  • The configuration of maximum retries is done via the HttpOptions object. If/when retries are applied to authentication requests, a similar configuration point will be added for clients to be able to independently configure the maximum retries.

@jimmyjames jimmyjames added this to the v1-Next milestone Aug 13, 2021
@jimmyjames jimmyjames requested a review from a team as a code owner August 13, 2021 17:33
Copy link
Copy Markdown
Contributor

@evansims evansims left a comment

Choose a reason for hiding this comment

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

LGTM! Awesome work on this 👍

@jimmyjames jimmyjames requested a review from lbalmaceda August 16, 2021 18:27
@jimmyjames
Copy link
Copy Markdown
Contributor Author

@lbalmaceda can you please have a look at this as well? Thanks!

@jimmyjames jimmyjames merged commit 529d430 into master Aug 19, 2021
@shoikot
Copy link
Copy Markdown

shoikot commented Aug 19, 2021

Awesome work, please notify me when this version is available on maven

@jimmyjames
Copy link
Copy Markdown
Contributor Author

Will do @shoikot, we may have some other changes to include in the next release, so it may be next week 👍

@jimmyjames jimmyjames modified the milestones: v1-Next, 1.34.0 Aug 27, 2021
@jimmyjames jimmyjames mentioned this pull request Aug 27, 2021
@jimmyjames
Copy link
Copy Markdown
Contributor Author

@shoikot this is available in maven central now, v1.34.0. Thanks!

@evansims evansims deleted the rate-limit-retry branch July 5, 2022 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants