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

Daniel Fuchs dfuchs at openjdk.org
Wed May 24 14:27:10 UTC 2023


On Wed, 17 May 2023 18:46:35 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

> 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 enabled, and 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.

This pull request has now been integrated.

Changeset: 736b90d5
Author:    Daniel Fuchs <dfuchs at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/736b90d54b51830de7757a8de3ad9c98437c824a
Stats:     933 lines in 32 files changed: 525 ins; 137 del; 271 mod

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

Reviewed-by: jpai

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

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


More information about the net-dev mailing list