Refactor URLSessionHTTPClient out of HTTPClient#127
Open
guoye-zhang wants to merge 3 commits intoapple:mainfrom
Open
Refactor URLSessionHTTPClient out of HTTPClient#127guoye-zhang wants to merge 3 commits intoapple:mainfrom
guoye-zhang wants to merge 3 commits intoapple:mainfrom
Conversation
Contributor
Author
|
The Linux test failure appears to be a preexisting issue on main: |
FranzBusch
approved these changes
Mar 9, 2026
Collaborator
Addressed in #128 |
xbhatnag
added a commit
that referenced
this pull request
Mar 11, 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, the raw server closes the connection correctly, by adding a `Connection: close` header to all responses. The server now reads only one set of request headers per connection, writes a response and then closes that connection. Connection re-use is not permitted. ### 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. --------- Co-authored-by: Fabian Fett <fabianfett@apple.com>
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.
Several changes in this PR: