Repository navigation
Conversation
The header read sleep was dropped after every parsed request head, so the reset path never ran on keep alive connections and each request allocated and registered a new timer. Keep the sleep and reset it for the next head instead. Closes hyperium#4280
This branch has not been deployed
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.
Closes #4280
poll_read_headclearedh1_header_read_timeout_futafter every parsed head, aka the reset branch never ran on keep alive connections, and every request allocated a fresh sleep and registered it with the timer driver. This keeps the sleep and only clears the running flag, next head resets the existing timer.Old sleep stays registered until the next head resets it. If a request takes longer than the timeout to handle, that can cause one spurious wakeup of the connection task, which does nothing because the timer isn't polled while it's not running.
Added
header_read_timeout_reuses_timer_across_requests, which countssleep_untilcalls over three keep alive requests. On master it counts 4 timers for one connection; with this change it counts 1. The existing header read timeout tests still pass, including the slow writes multiple requests case, which exercises the reset path.P.S. didnt see #4285 before submitting, if that works, just lmk and Ill delete this