RFR: 8317295: ResponseSubscribers.SubscriberAdapter should call the finisher function asynchronously

Daniel Fuchs dfuchs at openjdk.org
Fri Sep 29 09:54:19 UTC 2023


The finisher function supplied to `BodySubscribers.fromSubscriber` is specified to be called when `onComplete()` is called on the `BodySubscriber`. However, this function contains application code that may involve blocking operations. Though this is technically a user error to block in any function supplied to the HttpClient API, the `ResponseSubscribers.SubscriberAdapter` should protect itself against this by calling the finisher asynchronously, in the fork join pool.

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

Commit messages:
 - 8317295

Changes: https://git.openjdk.org/jdk/pull/15981/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15981&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8317295
  Stats: 35 lines in 2 files changed: 23 ins; 0 del; 12 mod
  Patch: https://git.openjdk.org/jdk/pull/15981.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15981/head:pull/15981

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


More information about the net-dev mailing list