Fwd: Class initialization pinning deadlock with Log4j 2

Alan Bateman alan.bateman at oracle.com
Mon Nov 3 08:55:10 UTC 2025


On 03/11/2025 02:44, Danny Thomas wrote:
> Hi folks,
>
> We saw a clinit deadlock with Log4j 2 and virtual threads recently. 
> It's common for libraries to use a mix of static and instance field 
> loggers, so seems particularly vulnerable to this kind of deadlock at 
> startup.
>
> I don't recall reading what you have planned for clinit pinning, so 
> thought I'd pass on this potentially common real-world deadlock and 
> ask what you have in mind for addressing this limitation.

The changes to preempt when a virtual thread must wait for a class to be 
initialized (by another thread) have been in the loom repo for sometime. 
This addresses the common cases. Patricio has JDK-8369238 [1] currently 
in review and should be in main line (and JDK 26 EA builds) soon.

-Alan

[1] https://bugs.openjdk.org/browse/JDK-8369238
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20251103/5935c9ca/attachment-0001.htm>


More information about the loom-dev mailing list