-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add support for automatic retries in case of failure #12
Comments
I think the API change that I'm currently working on would be able to provide such capabilities, because it now allows you to pass a Does that work for you? |
That could potentially work, although it would require consumers to create their own logic to handle retries. What I was thinking was adding an option to configure how the operation could be retried, letting jwx/httprc handle the retries (checking for network failures, then checking for status codes that are retriable). In one possible design, assuming you'd be ok with accepting a new dependency, it could be adding an option to accept a backoff.Backoff from In another design, which wouldn't require an external dependency,it could be as simple as passing a "MaxRetries" option, letting httprc figure out how to do the back-off. |
TBH I'm a bit meh about baking in retries, because retries usually tend to be fairly elaborate and its usage varies subtly depending on your requirements and environment. This in turn adds a bunch of possible failure modes and configuration possibilities. I've been burned before (implementation is not really the problem, I'm more concerned with the long term support issue), and have removed them when developing jwx v2 (sidenote: I also have a slight beef with passing closures to Retry() :) |
Understood (also I didn't know you had your own package) :) |
Would it be possible to add an option to httprc to automatically retry a request that fails? For example, due to transient network failures, server responding with an error status code, etc.
Note that we use httprc via
github.com/lestrrat-go/jwx/v2/jwk
The text was updated successfully, but these errors were encountered: