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

Allow configuring the connection timeout for HTTP clients. #177

Closed
Tracked by #114
tobz opened this issue Aug 12, 2024 · 0 comments · Fixed by #214
Closed
Tracked by #114

Allow configuring the connection timeout for HTTP clients. #177

tobz opened this issue Aug 12, 2024 · 0 comments · Fixed by #214
Labels
area/io General I/O and networking. effort/intermediate Involves changes that can be worked on by non-experts but might require guidance. good first issue Good for newcomers type/enhancement An enhancement in functionality or support.

Comments

@tobz
Copy link
Member

tobz commented Aug 12, 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.

We should be able to trivially support this by dropping down directly to HttpConnector (from hyper-util) when building our HttpsConnector, as it supports setting the connection timeout via 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.

We should check what Go does, in particular how the Datadog Agent is using net/http/Client, since we know that hosts will commonly resolve to multiple IP addresses when load balanced.. but it's not clear to me if Go/Datadog Agent are also going to try all of those IPs, and enforcing the connect timeout per IP, or just picking one IP, or doing what hyper-util also does, etc....

@tobz tobz added good first issue Good for newcomers area/io General I/O and networking. type/enhancement An enhancement in functionality or support. effort/intermediate Involves changes that can be worked on by non-experts but might require guidance. labels Aug 12, 2024
@tobz tobz added this to the ADP v0.3: Production Bound milestone Aug 13, 2024
@rayz rayz closed this as completed in #214 Aug 22, 2024
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. effort/intermediate Involves changes that can be worked on by non-experts but might require guidance. good first issue Good for newcomers type/enhancement An enhancement in functionality or support.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant