diff options
author | Steve Azzopardi <sazzopardi@gitlab.com> | 2023-01-30 09:21:17 +0100 |
---|---|---|
committer | Steve Azzopardi <sazzopardi@gitlab.com> | 2023-01-30 09:54:42 +0100 |
commit | 80f684e48eca2bf1ef2006d84f8c49bec7104344 (patch) | |
tree | d96c92030bfe86a5183a7268361b2ec70788f73c /internal/config/config.go | |
parent | 51eab44edafd0c097e82c1a74fd379cae4869a42 (diff) | |
download | gitlab-shell-80f684e48eca2bf1ef2006d84f8c49bec7104344.tar.gz |
feat: make retryable http default client
What
---
Make the retryableHTTP client introduced in
https://gitlab.com/gitlab-org/gitlab-shell/-/merge_requests/703 the
default HTTP client.
Why
---
In
https://gitlab.com/gitlab-com/gl-infra/production/-/issues/7979#note_1254964426
we've seen a 99% error reduction on `git` commands from `gitlab-shell`
when the retryableHTTP client is used.
This has been running in production for over 2 weeks in `us-east1-b` and
5 days fleet-wide so we should be confident that this client works as
expected.
Reference: https://gitlab.com/gitlab-com/gl-infra/production/-/issues/7979
Signed-off-by: Steve Azzopardi <sazzopardi@gitlab.com>
Diffstat (limited to 'internal/config/config.go')
-rw-r--r-- | internal/config/config.go | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index 207517b..cfee3d0 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -142,14 +142,8 @@ func (c *Config) HttpClient() (*client.HttpClient, error) { return } - if client.HTTPClient != nil { - tr := client.HTTPClient.Transport - client.HTTPClient.Transport = metrics.NewRoundTripper(tr) - } - if os.Getenv("FF_GITLAB_SHELL_RETRYABLE_HTTP") == "1" && client.RetryableHTTP != nil { - tr := client.RetryableHTTP.HTTPClient.Transport - client.RetryableHTTP.HTTPClient.Transport = metrics.NewRoundTripper(tr) - } + tr := client.RetryableHTTP.HTTPClient.Transport + client.RetryableHTTP.HTTPClient.Transport = metrics.NewRoundTripper(tr) c.httpClient = client }) |