-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix handling of retry-able requests 429 and 503 #200
Comments
@bkircher any thoughts? |
Yip, this is how it should be. Remember that polling on |
Yes. In gridscale/terraform-provider-gridscale#157 discussion, we found that gsclient-go handling of retries is totally wrong here. As per API doc, 429 should re-tried indefinitely, blocking (given proper handling of signals like SIGINT and friends) until 503 should also be retried but blocking on As for
Those should not be retried at all. |
Allow setting delay between requests and the maximum number of retries. The default no. of retries is set to 1. With this commit, TF provider reads two new environment variables: - GRIDSCALE_TF_REQUEST_DELAY_INTERVAL - GRIDSCALE_TF_MAX_N_RETRIES References: - gridscale/gsclient-go#200
Only 503 and 429 are retriable. Changes: See issue #200. Requests with 503 response code will be retried. If Retry-After response header is defined (x seconds), the next retry will be executed after x seconds. If that header is not included, the next retry depends on settings of gsclient-go (delayIntervalMilliSecs and maxNumberOfRetries). When the retry count of a request reaches maxNumberOfRetries, gsclient-go return the last request's error. Requests with 429 (rate-limit is reached) response code will also be retried when the rate-limit is reset. If the rate-limit is reached again, retry again in when the rate-limit is reset. There is no maxNumberOfRetries for 429 request retry. NOTE: if the context is Done() before retrying (or during retrying). An error caused by the expired context is returned.
A rate-limited request should be retried until the rate-limit is reset and the request is processed successfully. If the request is delayed again (due to rate-limit is reached again), keep retrying.
The text was updated successfully, but these errors were encountered: