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

A way to skip retrying non-idempotent requests #169

Open
d-honeybadger opened this issue Jun 30, 2022 · 0 comments
Open

A way to skip retrying non-idempotent requests #169

d-honeybadger opened this issue Jun 30, 2022 · 0 comments

Comments

@d-honeybadger
Copy link

When non-idempotent requests, e.g. POST, are retried, it can easily lead to data corruption and duplication.
One natural way to skip retrying those is with CheckRetry function. But in that function, one only has the response, and not the request, to make the decision based on. Since the response in nil when there are connection errors, one cannot check response.Request.Method in that case.

It would be pretty awesome to have request passed to CheckRetry alongside the response, but any other solution that would allow to skip retrying based on method would be great too.

Right now I'm having to use two separate http clients, one with retries and one without, depending on the method.

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

No branches or pull requests

1 participant