Skip to content

Fix bug with Raw Server causing AHC tests to fail on Linux#128

Open
xbhatnag wants to merge 2 commits intomainfrom
fix-raw-server
Open

Fix bug with Raw Server causing AHC tests to fail on Linux#128
xbhatnag wants to merge 2 commits intomainfrom
fix-raw-server

Conversation

@xbhatnag
Copy link
Collaborator

@xbhatnag xbhatnag commented Mar 9, 2026

Motivation

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 in 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 .end portion 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.

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`.
Copy link
Member

@fabianfett fabianfett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me.

cc @gjcairo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants