fix(proxy): time out an origin body that goes idle - #22
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.
An origin can send response headers and part of the body, then go silent. The proxy then no longer holds the client connection and the pooled origin connection open indefinitely. The proxy now applies
--upstream-timeout-secondsto silence during the response body. When the origin sends no data for that period, the proxy logs a warning with the target URI. It then ends the client's response with an error. With a coalesced miss, the proxy releases the waiting requests at that point, and each goes to the origin itself.Changes
Content-Lengthresponse ends short, and a chunked response gets no last chunk. TheTeedrops its copy, so the cache stores nothing and the flight guard drops.Verification
On
main, these five tests fail because the proxy keeps the connection open past the 10 second test limit:body_idle::sized_body_that_stalls_closes_the_client_connection_shortbody_idle::chunked_body_that_stalls_gets_no_last_chunkbody_idle::stalled_cacheable_body_is_not_storedcoalescing::followers_of_a_leader_whose_body_stalls_are_released_when_it_is_given_upbody_idle::background_revalidation_whose_body_stalls_is_given_up, which checks thatbackground_refreshesreaches 2body_idle::slow_but_steady_body_arrives_wholepasses onmain. It fails after 1 second against a version of the wrapper that never resets its timer.Not run: a check of the warning log line.