Details
Description
Repro steps:
- Unpack testcase.zip
- Run the Testcase class
- Application should deadlock at around "Progress: 340000" (within 10 seconds of startup for me)
This issue is 100% reproducible and only occurs when using JDK 19 virtual threads.
The bug seems to be triggered by RollingFileAppender.rollover().
Please note that using I/O inside synchronized blocks pins a carrier threads and this substantially reduces the performance of virtual threads. Please consider replacing such constructs with ReentrantLock or StampedLock as you have done elsewhere.
The deadlock might have something to do with all carrier threads waiting to acquire a synchronized block, while the thread holding the lock is blocked waiting for an I/O response. I'm not sure why the latter never comes back though...