Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[APR-241] Allow configuring the connection timeout for HTTP clients. #214

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

rayz
Copy link
Contributor

@rayz rayz commented Aug 22, 2024

Context

When building an HTTP client, we should be able to configure a timeout specifically for connecting to the downstream target system. This is a simple assurance against extended delays trying to connect to unresponsive systems.

Solution

Use HttpConnector::set_connect_timeout

Notes

One caveat is that set_connect_timeout carries the following note:

If a domain resolves to multiple IP addresses, the timeout will be evenly divided across them.

The datadog-agent uses the Dialer.Timeout field to set the timeout with a value of 30 which may also be divided

@github-actions github-actions bot added the area/io General I/O and networking. label Aug 22, 2024
@rayz rayz marked this pull request as ready for review August 22, 2024 19:39
@rayz rayz requested review from a team as code owners August 22, 2024 19:39
@tobz tobz linked an issue Aug 22, 2024 that may be closed by this pull request
@rayz rayz merged commit a007c20 into main Aug 22, 2024
13 checks passed
@tobz tobz deleted the rayz/configure-http-client-connection-timeout branch December 13, 2024 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/io General I/O and networking.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow configuring the connection timeout for HTTP clients.
2 participants