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

Support for Backoff #40

Merged
merged 7 commits into from
Sep 19, 2023

Conversation

euonymos
Copy link
Contributor

@euonymos euonymos commented Sep 16, 2023

Summary

To handle automatically rate limit errors this PR allows clients to use exponential backoff with maximum delay threshold by optionally specifying these two options when creating an environment with mkMaestroEnv. This solves #39.

Type of Change

Please mark the relevant option(s) for your pull request:

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (adding or updating documentation related to the project)

Checklist

Please ensure that your pull request meets the following criteria:

  • I have read the Contributing Guide
  • My code follows the project's coding style and best practices
  • My code is appropriately commented and includes relevant documentation
  • I have added tests to cover my changes
  • All new and existing tests pass
  • I have updated the documentation, if necessary

Testing

  • errors without backoff
  • works with default backoff settings

TODO

  • reformat code
  • add MAESTRO_API_KEY in CI?

@euonymos euonymos changed the title Euonymos/jitter backoff Jitter Backoff with Max Delay for V1 Sep 16, 2023
@sourabhxyz
Copy link
Contributor

Thanks a lot @euonymos for this contribution! I would have a thorough look at it tomorrow. At the same time, we have this PR: #33 which is what is being used for in some of the other tools, like Atlas. If you would like, you can set target of this PR to maestro-org:drop-v0.

@euonymos euonymos changed the title Jitter Backoff with Max Delay for V1 Support for Backoff Sep 19, 2023
@euonymos
Copy link
Contributor Author

Hey @sourabhxyz! I added a pair of tests, though they require an API key, so they will fail in CI. Not sure what's the best way to handle this. I also rebased on the branch you pointed out, thank you.

@euonymos euonymos changed the base branch from main to drop-v0 September 19, 2023 02:20
@euonymos euonymos marked this pull request as ready for review September 19, 2023 02:25
@euonymos euonymos requested a review from a team as a code owner September 19, 2023 02:25
@sourabhxyz
Copy link
Contributor

Thanks again @euonymos, I am merging this and would change few things slightly like changing the _ prefix in say _maeToken as I moved away from template haskell towards using generics for lenses.

@sourabhxyz sourabhxyz merged commit 086b9c2 into maestro-org:drop-v0 Sep 19, 2023
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.

2 participants