Skip to content

Implement standard retry policies for failed API requests #183

Open
@anikitin

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:

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions