-
Notifications
You must be signed in to change notification settings - Fork 23
Description
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).