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

HTTP client loses Timeout when using oauth #15899

Closed
lestrozi opened this issue Sep 16, 2024 · 0 comments · Fixed by #15900
Closed

HTTP client loses Timeout when using oauth #15899

lestrozi opened this issue Sep 16, 2024 · 0 comments · Fixed by #15900

Comments

@lestrozi
Copy link
Contributor

lestrozi commented Sep 16, 2024

The HTTP client is created passing a Transport and a Timeout, but is later reassigned to a OAuth2Config.CreateOauth2Client.

The oauth client just returns the original client if it's disabled, but it returns a new client otherwise.
The problem is that, while this client retains the transport configuration (set on ctx), it doesn't keep other settings such as Timeout.

This can be easily confirmed by setting, on outputs.http plugin config, an URL that will not respond to SYNs (such as http://5.5.5.5) and a valid token_url, client_id and client_secret.

After fetching the token, telegraf will try to connect to the HTTP endpoint and will only timeout when the OS times out the connect syscall (usually after about ~2 minutes, depending on the TCP backoff config). The goroutine is not blocked, it keeps doing epoll, but it doesn't respect the timeout.

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 a pull request may close this issue.

1 participant