-
Notifications
You must be signed in to change notification settings - Fork 24
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
Client retries for API-server errors #72
Comments
I think this makes a lot of sense, and would be useful to have in the client. There is a document essentially suggesting this behavior (exponential backoff) for many 500 range / server failure modes: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#error-codes For the error types you've included in the example above, I think it is fine to implement the retry behavior in the client. |
The document I linked above suggests that clients "Read the |
Ok. From the docs, it looks like it respects Retry-After by default for 429 statuses; I'll double-check that the other options don't interfere with that default behaviour |
This uses the urllib3 Retry to add retries with back-off to requests to the API-server that error. It will retry errors with the listed statuses, for all HTTP methods. If the response contains a Retry-After header (which we expect to be the case for 429/Too Many Requests), the delay it specifies will be respected. For other cases, it will back off exponentially (after one immediate retry, doubling) up to 10 times, with the library's maximum delay (120s). Fixes #72
This uses the urllib3 Retry to add retries with back-off to requests to the API-server that error. It will retry errors with the listed statuses, for all HTTP methods. If the response contains a Retry-After header (which we expect to be the case for 429/Too Many Requests), the delay it specifies will be respected. For other cases, it will back off exponentially (after one immediate retry, doubling) up to 10 times, with the library's maximum delay (120s). Fixes #72
This uses the urllib3 Retry to add retries with back-off to requests to the API-server that error. It will retry errors with the listed statuses, for all HTTP methods. If the response contains a Retry-After header (which we expect to be the case for 429/Too Many Requests), the delay it specifies will be respected. For other cases, it will back off exponentially (after one immediate retry, doubling) up to 10 times, with the library's maximum delay (120s). Fixes #72
We've been seeing issues where the API-server returns errors when fiaas-deploy-daemon is deploying things:
It seems like having some retry-with-backofff in these situations would be helpful. One doubt is about the level this should live at, but I think the simplest implementation will be in the HTTP client used here: with
requests
, it can be as simple as supplying a retry-config, that enumerates the status-codes to retry for. Something like this, ink8s.client
:This will retry for the listed statuses, on all HTTP methods, 10 times with a growing backoff,
starting at 0, then 2s, 4s, 8s etc. until the default max of 120s.
Does this seem reasonable?
The text was updated successfully, but these errors were encountered: