Skip to content

fix(client): use default retry policy from retryablehttp

This change set removes the custom default retry policy in favor of re-using the default retry policy from the retryablehttp package. We re-use it, but extend it to respect if the client was created with disabled retries. In that case, all retry attempts are rejected.

This change affects what is retried. The custom retry logic did not retry generic HTTP client response errors (see if err != nil { return false, err }. This is not desirable, because it wouldn't retry for things like connection errors that are normally retryable. Concretely, this affects errors like EOF, unexpected EOFs, connection reset errors, the use of closed connections, operation errors and other connection errors. We've been facing concrete connection errors when the server responded with GOAWAY in HTTP/2. We want to retry these GOAWAY errors. Specifically, we've experienced GOAWAY errors when the default limit for requests per HTTP/2 connection was reached. In that case we'd see a GOAWAY with the LastStreamID to be 1999.

Refs https://gitlab.com/gitlab-com/request-for-help/-/issues/3410+

Merge request reports

Loading