Skip to content

Add retry behaviour #772

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

Closed
estahn opened this issue Jun 23, 2023 · 3 comments
Closed

Add retry behaviour #772

estahn opened this issue Jun 23, 2023 · 3 comments
Labels
✨ enhancement New feature or improvement
Milestone

Comments

@estahn
Copy link

estahn commented Jun 23, 2023

Is your feature request related to a problem? Please describe.

Connections and API responses are flakey at times. A built-in retry mechanism could improve the success of responses.

Describe the solution you'd like

Use https://github.com/jd/tenacity (or similar) to add retry-behaviour.

@estahn estahn added the ✨ enhancement New feature or improvement label Jun 23, 2023
@dbanty dbanty added this to the 0.15.0 milestone Jul 7, 2023
@dbanty
Copy link
Collaborator

dbanty commented Jul 7, 2023

I'm going to consider #775 as fixing this since you will be able to use the built-in httpx retries as well as reuse client connections when doing other retries (a la tenacity). I think retries tend to be super specific to each use-case, so adding a default opinionated mechanism in every client probably won't be super useful.

@imadmoussa1
Copy link

The httpx retries only manage connection failure . will we be considering adding something more custom httpx retry requests to the generator ?

@dbanty dbanty closed this as completed Jul 23, 2023
@dbanty
Copy link
Collaborator

dbanty commented Jul 23, 2023

@imadmoussa1 I think desired retry behavior is going to depend a lot on the application and the API—I'd assume that most folks creating SDKs for an API would like to build in their recommended retry behavior 🤔. If there's enough demand for it, we could add some sort of retry config for certain responses (specifically, those which include a Retry-After header, just to avoid folks having to include tenacity as a dependency for common cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or improvement
Projects
None yet
Development

No branches or pull requests

3 participants