RFR: 8350451: HttpClient should not wait until the request body has been fully sent before reading the response headers [v2]

Daniel Fuchs dfuchs at openjdk.org
Wed Feb 26 11:55:56 UTC 2025


> Hi - Please find here a PR that improves streaming strategy in the HttpClient.
> 
> The HttpClient currently waits until the full request body has been sent before starting to listen for a response. This is not optimal, in particular in cases where the server sends back e.g. 500 without even reading the body. It also prevents starting to stream the response body from the server before having sent the full request body, which prevents the server to stream back the request body to the client without reading it fully first.
> 
> While writing a test to verify the fix, I also noticed a few places where additional tasks needed to be performed asynchronously (= delegated to the executor) to support this.

Daniel Fuchs has updated the pull request incrementally with one additional commit since the last revision:

  Review feedback

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/23716/files
  - new: https://git.openjdk.org/jdk/pull/23716/files/b88d346c..85e7d488

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=23716&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23716&range=00-01

  Stats: 22 lines in 3 files changed: 14 ins; 0 del; 8 mod
  Patch: https://git.openjdk.org/jdk/pull/23716.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23716/head:pull/23716

PR: https://git.openjdk.org/jdk/pull/23716


More information about the net-dev mailing list