Skip to content

Automatically retry on 429 Too Many Requests #770

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

soxofaan
Copy link
Member

@soxofaan soxofaan commented May 9, 2025

refs #441, #764

@soxofaan
Copy link
Member Author

soxofaan commented May 9, 2025

TODO:

  • changelog entry
  • allow user to easily configure retry settings (e.g. number of retries, backoff_factor)
  • tests about job.start_and_wait loop?

@soxofaan soxofaan linked an issue May 9, 2025 that may be closed by this pull request
@soxofaan soxofaan marked this pull request as ready for review May 9, 2025 15:11
DEFAULT_RETRY_FORCELIST = frozenset(
[
429, # Too Many Requests
500, # Internal Server Error
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe it's best to not include Internal Server Error by default for now.
Unlike the others (429/502/503/504) this is a very general error situation, and not something where we can assume that just waiting a bit and retrying will resolve the problem.

@soxofaan
Copy link
Member Author

soxofaan commented May 14, 2025

While working on the tests, it also occurred to me that this feature introduces a bit of conflict with poll-loop situations like job.start_and_wait() and the job manager where there is already skipping of "soft errors" or temporary glitches in some way.
By enabling this Retry adapter by default, the user experience (e.g. in terms of responsiveness or throughput of the poll-loops) will get worse because of multiple unnecessary but forced sleeps.

So this needs some more investigation (e.g can the retry config be disabled in particular places or contexts?)

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.

Automatic backoff/retry on HTTP 429 Too Many Requests
1 participant