Apply Repository Timeout To Response Header Wait - #95
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Since 1.21.0 the repository client is built with keel's
NewInternalHTTPClient(http command) andNewExternalHTTPClient(socket command). keel 0.29 hardcodesResponseHeaderTimeouton those transports: 5s internal, 10s external.--repository-timeoutonly setshttp.Client.Timeout, so the header timeout fires first.A cold
contentserverexportpoll builds the export synchronously and takes longer than 5s. Every poll is cancelled withnet/http: timeout awaiting response headers, the export keeps working on already-cancelled requests, and each poller adds another request every poll interval. The new pod never loads a repository, its startup probe stays 503, and it restarts until the export happens to finish for a still-connected client. This aborted two production rollouts on 2026-09-10.Fix
newRepositoryHTTPClientbuilds the client for both commands and passes the repository timeout toHTTPClientWithResponseHeaderTimeoutas well, before telemetry wraps the transport (keel panics otherwise).Verification
TestNewRepositoryHTTPClientWaitsForSlowHeadersserves headers after 6s (internal) and 11s (external) with a 30s repository timeout. Against the previous construction it fails with the production error on both paths; with this change it passes.make tidy,make lint,make testclean locally.