Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-1711

Deadlock when using Virtual Threads

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • 1.3.12, 1.5.7
    • 1.4.5
    • logback-core
    • None

    Description

      Repro steps:

      1. Unpack testcase.zip
      2. Run the Testcase class
      3. 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...

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            cowwoc Gili
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: