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

Extraneous warning message observed in XARecoveryModule.xaRecoverySecondPass if the first pass has already failed

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 4.17.23, 5.0.4
    • 4.17.20, 4.17.21, 5.0.2
    • JTA
    • None
    • Hide

      Add AMQ RA and configure it so it contains ServerUrl property that uses failover protocol for example:

      <config-property name="ServerUrl">
                              failover:(tcp://host1:61616?trace=true,tcp://host2:61616?trace=true)?initialReconnectDelay=100&amp;jms.rmIdFromConnectionId=true&amp;maxReconnectAttempts=0
                          </config-property>
      

      Start JBoss EAP server and wait until the recovery runs second time. The errors will appear in the server log file.

      Show
      Add AMQ RA and configure it so it contains ServerUrl property that uses failover protocol for example: <config-property name="ServerUrl"> failover:(tcp://host1:61616?trace=true,tcp://host2:61616?trace=true)?initialReconnectDelay=100&amp;jms.rmIdFromConnectionId=true&amp;maxReconnectAttempts=0 </config-property> Start JBoss EAP server and wait until the recovery runs second time. The errors will appear in the server log file.
    • Hide

      None

      Show
      None

      When using AMQ failover protocol, the Narayana recovery process generates the following exception:

      10:19:36,053 INFO  [org.apache.activemq.transport.failover.FailoverTransport] (ActiveMQ Task-1) Successfully connected to tcp://ragga:61616?trace=true
      10:21:46,139 INFO  [org.apache.activemq.transport.failover.FailoverTransport] (ActiveMQ Task-1) Successfully connected to tcp://ragga:61616?trace=true
      10:21:46,139 WARN  [com.arjuna.ats.jta] (Periodic Recovery) ARJUNA016027: Local XARecoveryModule.xaRecovery got XA exception XAException.XAER_RMERR: javax.transaction.xa.XAException: Failover transport not connected: unconnected
      	at org.apache.activemq.TransactionContext.recover(TransactionContext.java:656)
      	at org.apache.activemq.ra.LocalAndXATransaction.recover(LocalAndXATransaction.java:135)
      	at org.jboss.jca.core.tx.jbossts.XAResourceWrapperImpl.recover(XAResourceWrapperImpl.java:177)
      	at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.xaRecoveryFirstPass(XARecoveryModule.java:548) [jbossjts-jacorb-4.17.21.Final-redhat-1.jar:4.17.21.Final-redhat-1]
      	at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkFirstPass(XARecoveryModule.java:187) [jbossjts-jacorb-4.17.21.Final-redhat-1.jar:4.17.21.Final-redhat-1]
      	at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:743) [jbossjts-jacorb-4.17.21.Final-redhat-1.jar:4.17.21.Final-redhat-1]
      	at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:371) [jbossjts-jacorb-4.17.21.Final-redhat-1.jar:4.17.21.Final-redhat-1]
      
      10:21:56,165 WARN  [com.arjuna.ats.jta] (Periodic Recovery) ARJUNA016008: Local XARecoveryModule.xaRecovery - caught exception: java.lang.NullPointerException
      	at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.xaRecoverySecondPass(XARecoveryModule.java:619) [jbossjts-jacorb-4.17.21.Final-redhat-1.jar:4.17.21.Final-redhat-1]
      	at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.bottomUpRecovery(XARecoveryModule.java:431) [jbossjts-jacorb-4.17.21.Final-redhat-1.jar:4.17.21.Final-redhat-1]
      	at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkSecondPass(XARecoveryModule.java:212) [jbossjts-jacorb-4.17.21.Final-redhat-1.jar:4.17.21.Final-redhat-1]
      	at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:789) [jbossjts-jacorb-4.17.21.Final-redhat-1.jar:4.17.21.Final-redhat-1]
      	at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:371) [jbossjts-jacorb-4.17.21.Final-redhat-1.jar:4.17.21.Final-redhat-1]
      

      Although the first message may be expected if the resource manager throws an exception in XAResource::recover(), the second message does not add any further assistance in resolving the issue and should be removed as noise.

            [JBTM-2216] Extraneous warning message observed in XARecoveryModule.xaRecoverySecondPass if the first pass has already failed

            Tom Jenkinson added a comment - Resolved in https://github.com/jbosstm/narayana/commit/18f1884ee15da0c2ec6a2a33e2bdacd1f8187cca

            We should probably be more defensive, but the JTA spec "clearly" (well, as clearly as it ever does) doesn't allow null to be returned:

            "The resource manager returns zero or more Xids for the transaction branches that are currently in a prepared or heuristically completed state. If an error occurs during the operation, the resource manager should throw the appropriate XAException."

            So an array of 0 size is ok, but null isn't.

            Mark Little added a comment - We should probably be more defensive, but the JTA spec "clearly" (well, as clearly as it ever does) doesn't allow null to be returned: "The resource manager returns zero or more Xids for the transaction branches that are currently in a prepared or heuristically completed state. If an error occurs during the operation, the resource manager should throw the appropriate XAException." So an array of 0 size is ok, but null isn't.

            Also, the first issue is not harmless, it means that recovery isn't going to work for the resource manager.

            Tom Jenkinson added a comment - Also, the first issue is not harmless, it means that recovery isn't going to work for the resource manager.

            OK, I see your comment now. I will update the description to refer to the NPE rather than the error message coming from the resource manager.

            Tom Jenkinson added a comment - OK, I see your comment now. I will update the description to refer to the NPE rather than the error message coming from the resource manager.

            Hi Tom,

            Although I concede that the NPE is a little ugly, it won't have a material effect on the issue at hand.

            The core problem is:
            10:21:46,139 WARN [com.arjuna.ats.jta] (Periodic Recovery) ARJUNA016027: Local XARecoveryModule.xaRecovery got XA exception XAException.XAER_RMERR: javax.transaction.xa.XAException: Failover transport not connected: unconnected
            at org.apache.activemq.TransactionContext.recover(TransactionContext.java:656)
            at org.apache.activemq.ra.LocalAndXATransaction.recover(LocalAndXATransaction.java:135)
            at org.jboss.jca.core.tx.jbossts.XAResourceWrapperImpl.recover(XAResourceWrapperImpl.java:177)
            at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.xaRecoveryFirstPass(XARecoveryModule.java:548) [jbossjts-jacorb-4.17.21.Final-redhat-1.jar:4.17.21.Final-redhat-1]
            at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkFirstPass(XARecoveryModule.java:187) [jbossjts-jacorb-4.17.21.Final-redhat-1.jar:4.17.21.Final-redhat-1]
            at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:743) [jbossjts-jacorb-4.17.21.Final-redhat-1.jar:4.17.21.Final-redhat-1]
            at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:371) [jbossjts-jacorb-4.17.21.Final-redhat-1.jar:4.17.21.Final-redhat-1]

            This is an issue in the underlying resource manager and is not something that Narayana can handle any differently. We are calling XAResource::recover (http://docs.oracle.com/javaee/7/api/javax/transaction/xa/XAResource.html#recover(int)) and it is returning an error.

            If you are happy with my explanation I will change this bug to be that we should check for the possibility of null in the second phase of recovery though, as I say above, it won't have a material effect on your case.

            Tom

            Tom Jenkinson added a comment - Hi Tom, Although I concede that the NPE is a little ugly, it won't have a material effect on the issue at hand. The core problem is: 10:21:46,139 WARN [com.arjuna.ats.jta] (Periodic Recovery) ARJUNA016027: Local XARecoveryModule.xaRecovery got XA exception XAException.XAER_RMERR: javax.transaction.xa.XAException: Failover transport not connected: unconnected at org.apache.activemq.TransactionContext.recover(TransactionContext.java:656) at org.apache.activemq.ra.LocalAndXATransaction.recover(LocalAndXATransaction.java:135) at org.jboss.jca.core.tx.jbossts.XAResourceWrapperImpl.recover(XAResourceWrapperImpl.java:177) at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.xaRecoveryFirstPass(XARecoveryModule.java:548) [jbossjts-jacorb-4.17.21.Final-redhat-1.jar:4.17.21.Final-redhat-1] at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkFirstPass(XARecoveryModule.java:187) [jbossjts-jacorb-4.17.21.Final-redhat-1.jar:4.17.21.Final-redhat-1] at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:743) [jbossjts-jacorb-4.17.21.Final-redhat-1.jar:4.17.21.Final-redhat-1] at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:371) [jbossjts-jacorb-4.17.21.Final-redhat-1.jar:4.17.21.Final-redhat-1] This is an issue in the underlying resource manager and is not something that Narayana can handle any differently. We are calling XAResource::recover ( http://docs.oracle.com/javaee/7/api/javax/transaction/xa/XAResource.html#recover(int )) and it is returning an error. If you are happy with my explanation I will change this bug to be that we should check for the possibility of null in the second phase of recovery though, as I say above, it won't have a material effect on your case. Tom

            Tom Ross added a comment -

            As far as I can tell the exceptions are completely harmless.

            Tom Ross added a comment - As far as I can tell the exceptions are completely harmless.

              thjenkin@redhat.com Tom Jenkinson
              rhn-support-toross Tom Ross
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: