-
Notifications
You must be signed in to change notification settings - Fork 45
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
Retry transient HTTP Errors #311
Comments
This issue has been marked as stale because it has not had recent activity. The bot will close the issue if no further action occurs. |
Hey @mschfh, plainly retrying requests could be a bit dangerous, as we do not have an idempotent API. Actions might be taken twice, if the actual API request arrived at the backend, but then some proxy in the middle fails the request. Do you know of any SDKs/API Clients which do this? |
afaik aws's SDK does this https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html |
This issue has been marked as stale because it has not had recent activity. The bot will close the issue if no further action occurs. |
unstale |
Until we find out the best approach to solve this, you may use an external library that implement a retry round tripper: package main
import (
"net/http"
"github.com/hashicorp/go-retryablehttp"
"github.com/hetznercloud/hcloud-go/v2/hcloud"
)
func main() {
token := "YOUR_API_TOKEN"
httpClient := &http.Client{}
httpClient.Transport = &retryablehttp.RoundTripper{}
hcloud.NewClient(
hcloud.WithToken(token),
hcloud.WithHTTPClient(httpClient),
)
} |
Please (re)implement retries for transient HTTP error codes (502, 503, 504, etc) with sensible defaults
The text was updated successfully, but these errors were encountered: