Add configurable HTTP timeout for artifact fetching - #1464
Conversation
Signed-off-by: Kumar Piyush <kr.piyush888@gmail.com> Assisted-by: Cascade/SWE-1.6
|
Can you please open a PR in the website repo and add the new flag here: https://github.com/fluxcd/website/blob/main/content/en/flux/components/helm/options.md |
|
Sure, I'll do that. |
|
I've opened a PR that adds this flag on fluxcd/website: |
|
Hi @stefanprodan, @matheuscscp , Please consider backporting this PR to 1.5.x. |
|
Successfully created backport PR for |
Summary
This PR introduces a configurable timeout for HTTP requests used in artifact fetching to prevent indefinite blocking when the upstream source becomes unresponsive.
Problem
Currently, the retryable HTTP client does not set a timeout, allowing requests to block indefinitely if the underlying TCP connection remains open without a response.
Since retries are only triggered after a request fails, indefinitely blocking requests prevent retries from being invoked, leading to worker starvation and stalled reconciliations.
Root Cause
NewRetryableHTTPClient configures retry behavior but does not set HTTPClient.Timeout, leaving request duration unbounded.
Solution
This PR:
Impact
This ensures that stalled HTTP requests eventually fail, allowing retries and reconciliation loops to continue instead of blocking indefinitely.
Notes
Fixes #1463