Open
Description
It seems that SDK supports one-time retry out of the box for failed requests. We need to support more sophisticated policies, especially for internal clients. I suggest to implement the following policy as a default retry policy:
- For HTTP 4xx errors (except HTTP 429) no retries are made
- For 429 and 5xx
- Exponential backoff policy with jitter
- Initial retry interval is configured: default = minimum = 1 second)
- Number of retries is configured: minimum = 0, default = 3 retries, maximum should be limited, e.g. 20)
- Jitter randomization factor is configured: minimum = 0 (no jitter), default = 0.3, maximum =0.5
- If "Retry-After" header is returned by backend it has to be obeyed (current retry interval must NEVER be less than returned "Retry-After")
Client can define global policy or customize per API call.
SHould be eventually added to other SDKs as well.
See also: