Uploaded image for project: 'JBoss Transaction Manager'
  1. JBoss Transaction Manager
  2. JBTM-3734

Make Narayana virtual thread friendly

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Done
    • Minor
    • 7.0.0.Final
    • 5.13.1.Final
    • JTA
    • None
    • Hide
      Virtual Threads (JEP-444) support.

      This version replaces some synchronized methods with a new protected lock object (so that child classes can use it). Since this is a change to a public API we advise users to thoroughly test against this version.
      Show
      Virtual Threads (JEP-444) support. This version replaces some synchronized methods with a new protected lock object (so that child classes can use it). Since this is a change to a public API we advise users to thoroughly test against this version.

    Description

      Virtual threads do not play nice with synchronized blocks when the protected block executes network calls or other long running actions. This can lead to carrier thread pinning and deadlocks.

      From the JEP (425):
      Instead, avoid frequent and long-lived pinning by revising synchronized blocks or methods that run frequently and guard potentially long I/O operations to use java.util.concurrent.locks.ReentrantLock instead.

      This limitation is here to stay for the forseeable future, so many JDBC vendors including Oracle have already made the changes to their JDBC drivers, and many are doing it now, e.g. postgres: https://github.com/pgjdbc/pgjdbc/pull/2635

      I propose replacing the syncronized blocks in the transaction managers hot path that cause the thread pinnings in BasicAction and TwoPhaseCoordinator like in this patch: https://github.com/imperatorx/narayana/commit/346c843feda6c57433d448230a3eea6037feec87

      to avoid carrier thread pinning.

       

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              imperatorx Imperator X (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: