Fix bug with Raw Server causing AHC tests to fail on Linux#128
Open
Fix bug with Raw Server causing AHC tests to fail on Linux#128
Conversation
The Raw Server handler would `return` every time it received a non-head portion of the request. Unfortunately, every request has a `.end` portion in addition to the `.head` portion, meaning that the server would be tearing down the connection after one response despite not including `Connection: close`. To fix this, allow the connection to handle multiple requests by making this a `continue` instead of a `return`.
fabianfett
approved these changes
Mar 10, 2026
Member
fabianfett
left a comment
There was a problem hiding this comment.
Makes sense to me.
cc @gjcairo
gjcairo
approved these changes
Mar 10, 2026
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.
Motivation
The Raw Server handler would
returnevery time it received a non-head portion of the request. Unfortunately, every request has a.endportion in addition to the.headportion, meaning that the server would be tearing down the connection after one response despite not includingConnection: closein the headers, which confuses the client trying to reuse the connection.This caused AHC tests in Linux to flakily fail, as observed in #127
Modifications
To fix this, allow the raw server to handle multiple requests on the same connection by continuing past the
.endportion of a request instead of returning.Result
The AHC tests on Linux are not flaky anymore. Tested on docker container running 204 + 304 tests back to back 100+ times.
Test Plan
N/A. This fixes a test.