Skip to content

Conversation

@rafael7maia
Copy link

Problem:
The GitLab client was using the default HTTP client without retry logic or customized timeouts, causing net/http: TLS handshake timeout errors when connecting to GitLab API, especially on slow or unstable network connections.

Solution:
Configure the GitLab client with go-retryablehttp (already used for GitHub client) to handle temporary network issues and increase timeout thresholds:

  • TLS handshake timeout: 30 seconds (up from ~10s default)
  • Response header timeout: 30 seconds
  • Total request timeout: 60 seconds
  • Retry policy: up to 5 retries with exponential backoff (2s-30s)

Changes:

  • Added retryable HTTP client configuration for GitLab API calls
  • Applied same retry pattern already used for GitHub client
  • No breaking changes to existing functionality

Testing:
Tested successfully on projects with slow network conditions that previously failed with timeout errors.

References:

Configure GitLab client with retryable HTTP client to handle
temporary network issues and prevent TLS handshake timeouts.

- Add retry logic with exponential backoff (up to 5 retries)
- Increase TLS handshake timeout to 30 seconds
- Set response header timeout to 30 seconds
- Total request timeout set to 60 seconds

This matches the retry pattern already used for GitHub client
and resolves net/http timeout errors on slow connections.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant