RFR: 8308310: HttpClient: Avoid logging or locking from within synchronized blocks

Daniel Fuchs dfuchs at openjdk.org
Wed May 17 18:54:20 UTC 2023

Please find here a change that revisits usage of monitors in the HttpClient.

With Virtual Threads now part of the platform it should be possible to pass a newVirtualThreadPerTaskExecutor to the HttpClient. Logging, when called from a synchronized block, can cause the carrier thread to get pinned in case of contention when printing through the underlying PrintStream.

This change aims at avoiding situations where the carrier threads might get pinned.


Commit messages:
 - 8308310

Changes: https://git.openjdk.org/jdk/pull/14038/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=14038&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8308310
  Stats: 886 lines in 31 files changed: 518 ins; 110 del; 258 mod
  Patch: https://git.openjdk.org/jdk/pull/14038.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/14038/head:pull/14038

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

More information about the security-dev mailing list