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

Transaction manager definition race condition when setup after recovery service alread started

    XMLWordPrintable

Details

    • Hide

      Intermittently with

      export JBOSS_HOME=/home/ochaloup/jboss/wildfly/dist/target/wildfly-12.0.0.Final-SNAPSHOT
      cp $JBOSS_HOME/docs/examples/configs/standalone-rts.xml $JBOSS_HOME/standalone/configuration/
      sed -i 's/\(<recovery-environment \)/\1 recovery-listener="true" /' $JBOSS_HOME/standalone/configuration/standalone-rts.xml
      cd rts/at/bridge
      mvn test -Parq
      
      Show
      Intermittently with export JBOSS_HOME=/home/ochaloup/jboss/wildfly/dist/target/wildfly-12.0.0.Final-SNAPSHOT cp $JBOSS_HOME/docs/examples/configs/standalone-rts.xml $JBOSS_HOME/standalone/configuration/ sed -i 's/\(<recovery-environment \)/\1 recovery-listener= " true " /' $JBOSS_HOME/standalone/configuration/standalone-rts.xml cd rts/at/bridge mvn test -Parq

    Description

      By hanging RTS tests (JBTM-2995) we found there is a race condition happening in definition of JTS vs. JTA transaction manager implementation for the JTAEnvironmentBean.

      It could happen that

      1. transaction manager imple class is pushed to the JTAEnvironmentBean from narayana-jts-idlj by descriptor jbossts-properties.xml as JTS implementation
      2. recovery process is started and takes info about used JTS implementation for the manager and thus runs XAImporter in jts version
      3. JTAEnvironmentBean is changed to report JTA is in use
      4. recovery fails as ORB was not initialized

      Some more details:

      When the failure happens the jts version is in serve (com.arjuna.ats.internal.jta.transaction.jts.jca.TransactionImporterImple). That's because of race condition of transaction manager instance being used. The SubordinationManager decides based on the transaction manager implementation is setup in JTAEnvironmentBean (https://github.com/jbosstm/narayana/blob/master/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/jca/SubordinationManager.java#L144). At time the JTAEnvironmentBeanService is started (https://github.com/wildfly/wildfly/blob/master/transactions/src/main/java/org/jboss/as/txn/service/JTAEnvironmentBeanService.java#L60) the content of the transactionManagerClassName is setup (https://github.com/jbosstm/narayana/blob/master/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/JTAEnvironmentBean.java#L54) based on the jbossts-properties.xml from https://github.com/jbosstm/narayana/blob/master/ArjunaJTS/narayana-jts-idlj/src/main/resources/jbossts-properties.xml#L149 where jts transaction manager is configured. Then recovery manager service is started and before the setup to the JTA transaction manager, by definition taken from standalone.xml in WFLY, is done (https://github.com/wildfly/wildfly/blob/master/transactions/src/main/java/org/jboss/as/txn/service/ArjunaTransactionManagerService.java#L102) the recovery already starts (https://github.com/wildfly/wildfly/blob/master/transactions/src/main/java/org/jboss/as/txn/subsystem/TransactionSubsystemAdd.java#L243) and uses jts importer which fails of not having ORB configured.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: