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

Possible race condition at jts integration test com.arjuna.ats.jta.distributed.SimpleIsolatedServers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 5.9.6.Final
    • 5.9.5.Final
    • Testing
    • None

      There is a possible race condition at the test SipleIsolatedServers#testSimultaneousRecover (https://github.com/jbosstm/narayana/blob/5.9.5.Final/ArjunaJTS/integration/src/test/java/com/arjuna/ats/jta/distributed/SimpleIsolatedServers.java#L306) where while loop can be infinite as the counter never gets expected number of 2.

      This can happen in case of the recovery fails with some unexpected exception/error. For example the CI experienced java.lang.LinkageError on JDK11.
      (The exact reason for the linkage error is for further investigation. But the test should be fixed.)

      [1]

      [RecMan1000] ProxyXAResource (1000:2000) XA_RECOVER [XAResource.TMSTARTRSCAN]
      Exception in thread "RecMan1000" java.lang.LinkageError: loader com.arjuna.ats.jta.distributed.server.IsolatableServersClassLoader @72503b19 (instance of com.arjuna.ats.jta.distributed.server.IsolatableServersClassLoader, child of 'app' jdk.internal.loader.ClassLoaders$AppClassLoader) attempted duplicate class definition for com.arjuna.ats.internal.jta.transaction.arjunacore.jca.SubordinationManager.
       at java.base/java.lang.ClassLoader.defineClass1(Native Method)
       at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
       at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:877)
       at com.arjuna.ats.jta.distributed.server.IsolatableServersClassLoader.loadClass(IsolatableServersClassLoader.java:125)
       at com.arjuna.ats.jta.distributed.server.IsolatableServersClassLoader.loadClass(IsolatableServersClassLoader.java:103)
       at com.arjuna.ats.jta.distributed.server.impl.RemoteServerImpl.recoverFor(RemoteServerImpl.java:111)
       at com.arjuna.ats.jta.distributed.server.impl.ProxyXAResource.recover(ProxyXAResource.java:174)
       at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.xaRecoveryFirstPass(XARecoveryModule.java:634)
       at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkFirstPass(XARecoveryModule.java:226)
       at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.getNewXAResource(XARecoveryModule.java:329)
       at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.getNewXAResource(XARecoveryModule.java:368)
       at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.getNewXAResource(XAResourceRecord.java:1254)
       at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.restore_state(XAResourceRecord.java:1005)
       at com.arjuna.ats.arjuna.coordinator.BasicAction.restore_state(BasicAction.java:1120)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.subordinate.jca.SubordinateAtomicAction.restore_state(SubordinateAtomicAction.java:212)
       at com.arjuna.ats.arjuna.coordinator.BasicAction.activate(BasicAction.java:490)
       at com.arjuna.ats.arjuna.coordinator.BasicAction.activate(BasicAction.java:453)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.subordinate.jca.SubordinateAtomicAction.<init>(SubordinateAtomicAction.java:75)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.subordinate.jca.TransactionImple.<init>(TransactionImple.java:71)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.jca.TransactionImporterImple.recoverTransaction(TransactionImporterImple.java:124)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.jca.TransactionImporterImple.recoverTransaction(TransactionImporterImple.java:52)
       at com.arjuna.ats.internal.jta.recovery.arjunacore.SubordinateAtomicActionRecoveryModule.periodicWorkFirstPass(SubordinateAtomicActionRecoveryModule.java:74)
       at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:770)
       at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWork(PeriodicRecovery.java:493)
       at com.arjuna.ats.internal.arjuna.recovery.RecoveryManagerImple.scan(RecoveryManagerImple.java:138)
       at com.arjuna.ats.arjuna.recovery.RecoveryManager.scan(RecoveryManager.java:161)
       at com.arjuna.ats.jta.distributed.server.impl.ServerImpl.doRecoveryManagerScan(ServerImpl.java:197)
       at com.arjuna.ats.jta.distributed.SimpleIsolatedServers$4.run(SimpleIsolatedServers.java:299)
       at java.base/java.lang.Thread.run(Thread.java:834)
      

      The stuck tread waits at

      "main" #1 prio=5 os_prio=0 cpu=4031.25ms elapsed=61387.77s tid=0x000000422f702800 nid=0x25fc in Object.wait()  [0x000000422eeae000]
         java.lang.Thread.State: TIMED_WAITING (on object monitor)
       at java.lang.Object.wait(java.base@11.0.2/Native Method)
       - waiting on <no object reference available>
       at com.arjuna.ats.jta.distributed.SimpleIsolatedServers.testSimultaneousRecover(SimpleIsolatedServers.java:307)
       - waiting to re-lock in wait() <0x0000000766d00038> (a com.arjuna.ats.jta.distributed.SimpleIsolatedServers$CompletionCountLock)
       at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@11.0.2/Native Method)
       at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@11.0.2/NativeMethodAccessorImpl.java:62)
       at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@11.0.2/DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(java.base@11.0.2/Method.java:566)
       at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
       at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
       at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
       at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
       at org.jboss.byteman.contrib.bmunit.BMUnitRunner$7.evaluate(BMUnitRunner.java:294)
       at org.jboss.byteman.contrib.bmunit.BMUnitRunner$6.evaluate(BMUnitRunner.java:263)
       at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
       at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
       at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
       at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
       at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
       at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
       at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
       at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
       at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
       at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
       at org.jboss.byteman.contrib.bmunit.BMUnitRunner$1.evaluate(BMUnitRunner.java:97)
       at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
       at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365)
       at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:272)
       at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:236)
       at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159)
       at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:386)
       at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:323)
       at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:143)
      

              ochaloup@redhat.com Ondrej Chaloupka (Inactive)
              ochaloup@redhat.com Ondrej Chaloupka (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: