activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Tully (JIRA)" <>
Subject [jira] [Reopened] (AMQ-2191) Incorrect handling of interruptions during commit or rollback of a transaction
Date Wed, 18 Nov 2015 14:58:11 GMT


Gary Tully reopened AMQ-2191:
      Assignee: Gary Tully  (was: Rob Davies)

I have come across a similar issue, different TM but that is incidental.
In my case, it is an ack as part of commit that sees the first interrupt. This causes a beforecompletion
error. However on the rollback, the ack is done/gone and the broker side acks are missing
so even after the client side rollback, the messages remain inflight to the consumer. 
>From what I can see, it is not safe to assume a retry of a commit/rollback op is sufficient.
I think that an InterruptedIOException in the XA case should be reported to the exception
listener and allow the connection to close, forcing a rollback broker side and forcing a rollback
client side also.
2015-08-19 10:17:03,827 WARN [com.arjuna.ats.arjuna] (Transaction Reaper) ARJUNA012117: TransactionReaper::check
timeout for TX 0:ffff650182a8:58549259:55d38674:22df0 in state RUN
2015-08-19 10:17:04,065 WARN [com.arjuna.ats.arjuna] (Transaction Reaper) ARJUNA012117: TransactionReaper::check
timeout for TX 0:ffff650182a8:58549259:55d38674:22dec in state CANCEL
2015-08-19 10:17:04,328 WARN [com.arjuna.ats.arjuna] (Transaction Reaper) ARJUNA012117: TransactionReaper::check
timeout for TX 0:ffff650182a8:58549259:55d38674:22df0 in state SCHEDULE_CANCEL
2015-08-19 10:17:04,488 WARN [com.arjuna.ats.jta] (Transaction Reaper Worker 0) ARJUNA016045:
attempted rollback of < formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffff650182a8:58549259:55d38674:22dec,
node_name=1, branch_uid=0:ffff650182a8:58549259:55d38674:22ded, subordinatenodename=null,
eis_name=unknown eis name > (org.apache.activemq.ra.LocalAndXATransaction@3de1f429) failed
with exception code XAException.XAER_RMFAIL: javax.transaction.xa.XAException:
at org.apache.activemq.TransactionContext.toXAException(
at org.apache.activemq.TransactionContext.rollback(
at org.apache.activemq.ra.LocalAndXATransaction.rollback(
at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelAbort(
at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort( [jbossjts-jacorb-4.17.7.Final-redhat-4-bz-1023562.jar:4.17.7.Final-redhat-1]
at com.arjuna.ats.arjuna.coordinator.BasicAction.doAbort( [jbossjts-jacorb-4.17.7.Final-redhat-4-bz-1023562.jar:4.17.7.Final-redhat-1]
at com.arjuna.ats.arjuna.coordinator.BasicAction.Abort( [jbossjts-jacorb-4.17.7.Final-redhat-4-bz-1023562.jar:4.17.7.Final-redhat-1]
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.cancel(
at com.arjuna.ats.arjuna.AtomicAction.cancel( [jbossjts-jacorb-4.17.7.Final-redhat-4-bz-1023562.jar:4.17.7.Final-redhat-1]
at com.arjuna.ats.arjuna.coordinator.TransactionReaper.doCancellations(
Caused by: javax.jms.JMSException:
at org.apache.activemq.util.JMSExceptionSupport.create(
at org.apache.activemq.ActiveMQConnection.doAsyncSendPacket(
at org.apache.activemq.ActiveMQConnection.asyncSendPacket(
at org.apache.activemq.ActiveMQSession.asyncSendPacket(
at org.apache.activemq.ActiveMQSession$5.afterRollback(
at org.apache.activemq.TransactionContext.afterRollback(
at org.apache.activemq.TransactionContext.rollback(
... 9 more
Caused by:
at org.apache.activemq.transport.WireFormatNegotiator.oneway(
at org.apache.activemq.transport.MutexTransport.oneway(
at org.apache.activemq.transport.ResponseCorrelator.oneway(
at org.apache.activemq.ActiveMQConnection.doAsyncSendPacket(
... 14 more
2015-08-19 10:17:04,493 WARN [com.arjuna.ats.arjuna] (Transaction Reaper Worker 0) ARJUNA012091:
Top-level abort of action 0:ffff650182a8:58549259:55d38674:22dec received TwoPhaseOutcome.FINISH_ERROR
from com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord
2015-08-19 10:17:15,361 WARN [com.arjuna.ats.arjuna] (default-threads - 46) ARJUNA012077:
Abort called on already aborted atomic action 0:ffff650182a8:58549259:55d38674:22dec{code}

> Incorrect handling of interruptions during commit or rollback of a transaction
> ------------------------------------------------------------------------------
>                 Key: AMQ-2191
>                 URL:
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.3.0
>         Environment: Java 1.6.0_02
> Kubuntu Linux  2.6.24-22
> Bitronix Transaction Manager 1.3.2
>            Reporter: Michael Gottschalk
>            Assignee: Gary Tully
>             Fix For: 5.3.1, 5.4.0
>         Attachments: ACTIVEMQ-PATCH, activemq_interruption_fix.diff, xa-jms-exception.txt
> We have a process framework that sends interruptions to threads that should be stopped
or paused. Some of these threads interact with ActiveMQ, so interruptions can occur inside
ActiveMQ at different points.
> A problem occurs if the interruption is detected in ActiveMQConnection.syncSendPacket
during commit or rollback of a transaction. ActiveMQ then throws a JMSException so that it
appears to Bitronix as if the XA transaction is in an inconsistent state (see stacktrace in
the attached file).
> In our opinion, the interruption should be ignored by ActiveMQ during the critical commit
or rollback phase. It is not mandatory that an interruption has an immediate effect. Especially
such a non-interruptable step as rollback or commit should be performed even though an interruption
> I created a patch for the class TransactionContext which, in case of an interruption,
resets the interruption state of the thread, retries the syncSendPacket method call and restores
the thread's interruption state afterwards. In this manner, no inconsistent state exceptions
occur in the transaction manager any longer and interruption is deferred until the commit/rollback
has succeeded.

This message was sent by Atlassian JIRA

View raw message