Skip to content

Support any number of attempts from [1, inf) on transport errors #151

@najork

Description

@najork

What happened?

The current usage of "retries" in the client configuration is ambiguous and requires exploring the code to understand how to configure the client to make one attempt (no retries), two attempts (one retry), and unlimited attempts. Furthermore, the current implementation does not allow you to configure the client to make exactly one attempt since the request retrier performs the conditional check retryCount <= maxRetries when determining whether it should retry but the client builder overrides instances where maxRetries == 0 with maxRetries = 2 * len(b.uris).

What did you want to happen?

We should support any number of attempts, from one to unlimited. In order to do so, I propose replacing "retries" with "attempts" to disambiguate the expected behavior. This includes a breaking change as it requires renaming configuration fields and exposed functions. For example, see httpclient.WithMaxRetries. We should also fix the existing implementation to support the full attempt range from [1, inf).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions