-
Notifications
You must be signed in to change notification settings - Fork 583
client: gophercloud should respect "Retry-After" response header #2096
Description
When OpenStack service throttles and responses with the 429 response code and "Retry-After" response header, provider client should backoff and wait for "Retry-After" before the next try.
The default backoff function should be called unless the RetryBackoffDisabled provider struct member is true. This will allow to enable the backoff logic by default and simplify the integration in dependent projects.
In order to give more control, the RetryBackoffFunc provider struct member can be defined (by analogy with ReauthFunc).
The default MaxBackoffRetries provider struct member should be set to DefaultMaxBackoffRetries const. When an amount of backoff retries is greater than MaxBackoffRetries, provider client should return the 429 error.
Reference:
- https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.37
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
see also #1918