You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Diptesh Chakraborty (JIRA)" <ji...@apache.org> on 2018/07/31 13:48:00 UTC

[jira] [Commented] (AMQ-2191) Incorrect handling of interruptions during commit or rollback of a transaction

    [ https://issues.apache.org/jira/browse/AMQ-2191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16563692#comment-16563692 ] 

Diptesh Chakraborty commented on AMQ-2191:
------------------------------------------

I am still getting this exception with 5.13 on the following scenario:

1) We have a producer template which writes messages to queue without using transaction.

2) When the queue depth reaches around 75000, we are getting the same exception which is mentioned below. 

3) When @Transaction is applied on the producerTemplate.send() , everything works fine.

 
Exception in thread "Thread-10" org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[ID-ip-10-64-0-34-ap-southeast-2-compute-internal-37287-1533002989787-0-96420][Message: CB occured during JMS processing; nested exception is javax.jms.JMSException: java.io.InterruptedIOException
at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:316)
at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:169)
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:497)
at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.java:245)
at org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:413)
at org.apache.camel.component.jms.JmsProducer.processInOnly(JmsProducer.java:367)
at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:153)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
at org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:68)
at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:412)
at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:380)
at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:270)
at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:380)
at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:221)
at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:124)
at org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeaders(DefaultProducerTemplate.java:233)
... 2 more
Caused by: javax.jms.JMSException: java.io.InterruptedIOException
at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62)
at org.apache.activemq.ActiveMQConnection.doAsyncSendPacket(ActiveMQConnection.java:1292)
at org.apache.activemq.ActiveMQConnection.asyncSendPacket(ActiveMQConnection.java:1284)
at org.apache.activemq.TransactionContext.begin(TransactionContext.java:237)
at org.apache.activemq.ActiveMQSession.doStartTransaction(ActiveMQSession.java:1809)
at org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1735)
at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:277)
at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:212)
at org.apache.activemq.pool.PooledProducer.send(PooledProducer.java:79)
at org.apache.activemq.pool.PooledProducer.send(PooledProducer.java:62)
at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:636)
at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.doSend(JmsConfiguration.java:353)
at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.doSendToDestination(JmsConfiguration.java:292)
at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.access$100(JmsConfiguration.java:234)
at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate$1.doInJms(JmsConfiguration.java:248)
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:494)
... 16 more
Caused by: java.io.InterruptedIOException
at org.apache.activemq.transport.WireFormatNegotiator.oneway(WireFormatNegotiator.java:102)
at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:68)
at org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelator.java:60)
at org.apache.activemq.ActiveMQConnection.doAsyncSendPacket(ActiveMQConnection.java:1290)
 

> Incorrect handling of interruptions during commit or rollback of a transaction
> ------------------------------------------------------------------------------
>
>                 Key: AMQ-2191
>                 URL: https://issues.apache.org/jira/browse/AMQ-2191
>             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
>            Priority: Major
>             Fix For: 5.13.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 occurs.
> 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
(v7.6.3#76005)