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

Commit failure in WFLY LocalResource does not return error to the caller

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • 5.7.2.Final
    • 5.7.1.Final
    • JTA
    • None
    • Hide

      Test at:
      https://github.com/ochaloup/wildfly/tree/last-resource-fail-on-commit

      git clone https://github.com/ochaloup/wildfly.git -b  last-resource-fail-on-commit
      ./build.sh install -B  -fae -DallTests -DskipTests
      export JBOSS_HOME=$PWD/dist/target/wildfly-12.0.0.Alpha1-SNAPSHOT
      ./integration-tests.sh clean install -Dts.noSmoke -Dts.basic -Djboss.dist=$JBOSS_HOME -Dtest=TransactionOnePhaseTestCase
      
      # to debug
      cd testsuite/integration/basic/
      mvn clean test -Dcheckstyle.skip -Denforcer.skip -DtestLogToFile=false "-Djvm.args.other=-server -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y" -Dsecurity.manager -Dtest=TransactionOnePhaseTestCase#localOnePhaseCommitFail
      
      Show
      Test at: https://github.com/ochaloup/wildfly/tree/last-resource-fail-on-commit git clone https: //github.com/ochaloup/wildfly.git -b last-resource-fail-on-commit ./build.sh install -B -fae -DallTests -DskipTests export JBOSS_HOME=$PWD/dist/target/wildfly-12.0.0.Alpha1-SNAPSHOT ./integration-tests.sh clean install -Dts.noSmoke -Dts.basic -Djboss.dist=$JBOSS_HOME -Dtest=TransactionOnePhaseTestCase # to debug cd testsuite/integration/basic/ mvn clean test -Dcheckstyle.skip -Denforcer.skip -DtestLogToFile= false "-Djvm.args.other=-server -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y" -Dsecurity.manager -Dtest=TransactionOnePhaseTestCase#localOnePhaseCommitFail

    Description

      In case that an exception is thrown during one-phase commit of non-XA transaction participant the error is swallowed and not returned to the caller. When tested with WFLY the excpetion is shown in the log, the commit fails but the client thinks that everything worked well.

      The relevant part of the exception stacktrace when error on commit occurs is

              at com.mysql.jdbc.ConnectionImpl.commit(ConnectionImpl.java:1549)
              at org.jboss.jca.adapters.jdbc.local.LocalManagedConnection.commit(LocalManagedConnection.java:96)
              at org.jboss.jca.core.tx.jbossts.LocalXAResourceImpl.commit(LocalXAResourceImpl.java:172)
              at com.arjuna.ats.internal.jta.resources.arjunacore.XAOnePhaseResource.commit(XAOnePhaseResource.java:120)
              at com.arjuna.ats.internal.arjuna.abstractrecords.LastResourceRecord.topLevelPrepare(LastResourceRecord.java:152)
              at com.arjuna.ats.arjuna.coordinator.AbstractRecord.topLevelOnePhaseCommit(AbstractRecord.java:428)
              at com.arjuna.ats.arjuna.coordinator.BasicAction.onePhaseCommit(BasicAction.java:2386)
              at com.arjuna.ats.arjuna.coordinator.BasicAction.End(BasicAction.java:1497)
      

      It seems that there is issue at
      https://github.com/jbosstm/narayana/blob/master/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/resources/arjunacore/XAOnePhaseResource.java#L164
      which does say something about recovery but for one phase nonXA there will be no recovery.

      The decision that the XAOnePhaseResource is used for the txn work is done at
      https://github.com/jbosstm/narayana/blob/master/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/TransactionImple.java#L792
      where depending how the setup of jtaEnvironmentBean.setLastResourceOptimisationInterfaceClassName was done. This is done in WFLY at
      https://github.com/wildfly/wildfly/blob/master/transactions/src/main/java/org/jboss/as/txn/service/JTAEnvironmentBeanService.java#L60

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: