Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-19566

Resolve virtual thread pinning issues in client side Artemis code

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • JMS
    • ---
    • ---

      When I was testing executing WildFly workloads on a virtual thread, turning on JVM thread pinning logging (see WFLY-19536) revealed pinning happening in client-side Artemis code (e.g. sending JMS messages). This issue is to trace working with the Artemis community to resolve these issues and get the fixed code into WildFly.

      See occurrences of 'onPinned' in https://ci.wildfly.org/repository/download/WF_MainNightlyJobs_StandardLinuxJdk21/446569:id/testsuite/integration/basic/target/wildfly/standalone/log/server.log. Lines in the stack trace annotated with "<== monitor" show where a monitor lock was taken that results in pinning when blocking code executes.

      An example:

      2024-07-18 04:55:23,274 INFO  [stdout] (ForkJoinPool-1-worker-1) Thread[#297,ForkJoinPool-1-worker-1,5,CarrierThreads]
      2024-07-18 04:55:23,275 INFO  [stdout] (ForkJoinPool-1-worker-1)     java.base/java.lang.VirtualThread$VThreadContinuation.onPinned(VirtualThread.java:185)
      2024-07-18 04:55:23,275 INFO  [stdout] (ForkJoinPool-1-worker-1)     java.base/jdk.internal.vm.Continuation.onPinned0(Continuation.java:393)
      2024-07-18 04:55:23,276 INFO  [stdout] (ForkJoinPool-1-worker-1)     java.base/java.lang.VirtualThread.parkNanos(VirtualThread.java:631)
      2024-07-18 04:55:23,276 INFO  [stdout] (ForkJoinPool-1-worker-1)     java.base/java.lang.System$2.parkVirtualThread(System.java:2648)
      2024-07-18 04:55:23,276 INFO  [stdout] (ForkJoinPool-1-worker-1)     java.base/jdk.internal.misc.VirtualThreads.park(VirtualThreads.java:67)
      2024-07-18 04:55:23,276 INFO  [stdout] (ForkJoinPool-1-worker-1)     java.base/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:267)
      2024-07-18 04:55:23,276 INFO  [stdout] (ForkJoinPool-1-worker-1)     java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:756)
      2024-07-18 04:55:23,276 INFO  [stdout] (ForkJoinPool-1-worker-1)     java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1126)
      2024-07-18 04:55:23,276 INFO  [stdout] (ForkJoinPool-1-worker-1)     java.base/java.util.concurrent.CountDownLatch.await(CountDownLatch.java:276)
      2024-07-18 04:55:23,277 INFO  [stdout] (ForkJoinPool-1-worker-1)     org.apache.activemq.artemis.client@2.35.0//org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl.waitForTopology(ClientSessionFactoryImpl.java:544)
      2024-07-18 04:55:23,277 INFO  [stdout] (ForkJoinPool-1-worker-1)     org.apache.activemq.artemis.client@2.35.0//org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:773)
      2024-07-18 04:55:23,277 INFO  [stdout] (ForkJoinPool-1-worker-1)     org.apache.activemq.artemis.client@2.35.0//org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:913) <== monitors:1
      

      To reproduce build https://github.com/bstansberry/wildfly/tree/pinning_check on SE 21.

            ehugonne1@redhat.com Emmanuel Hugonnet
            bstansbe@redhat.com Brian Stansberry
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: