activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Tully (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AMQ-4636) JDBCPersistence DB stopped during message send; JMSException is sent back to client rather than shutting down connection
Date Thu, 18 Jul 2013 10:24:49 GMT

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

Gary Tully commented on AMQ-4636:
---------------------------------

there are two problems here.
1) there is no callback to the IOExceptionHandler in org.apache.activemq.store.jdbc.TransactionContext.close
so the exception is not intercepted.

2) When an IOExceptionHandler wants to 'handle' an exception by stopping broker or transports,
there is a race between the async stop and the exception response.

For 1, we need to invoke the handler
for 2, we need to let the IOExceptionHandler wrap the exception to indicate that it is handled
such that can be trapped by org.apache.activemq.broker.TransportConnection#service and ignored.
Something like SuppressReplyOnHandled(IOException).
                
> JDBCPersistence DB stopped during message send; JMSException is sent back to client rather
than shutting down connection
> ------------------------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-4636
>                 URL: https://issues.apache.org/jira/browse/AMQ-4636
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.8.0
>         Environment: tested on trunk.
>            Reporter: Pat Fox
>         Attachments: AMQ4636Test.java
>
>
> Broker is configured to use JDBCIOExceptionHandler.
> When the JDBCPersistence DB is stopped during a message send the broker returns the following
javax.jms.JMSException back to the client rather than closing the connection.
> This results in the client having to deal with the exception instead of the failover
transport having to deal with a connection loss and redeliver the message. Failover transport
and transport connection loss seems to be the approach used when other SQL exceptions are
thrown.
> {code}
> Exception received on client side:
> javax.jms.JMSException: ORA-01089: immediate shutdown in progress - no operation
> s are permitted
>         at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSuppo
> rt.java:54)
>         at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnect
> ion.java:1391)
>         at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnect
> ion.java:1319)
>         at org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1798)
>         at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProdu
> cer.java:289)
>         at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProdu
> cer.java:224)
>         at org.apache.activemq.ActiveMQMessageProducerSupport.send(ActiveMQMessa
> geProducerSupport.java:241)
>         at com.acme.MyPublisher.doIt(MyPublisher.java:50)
>         at com.acme.MyPublisher.main(MyPublisher.java:26)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
>         at java.lang.Thread.run(Thread.java:662)
> Caused by: java.io.IOException: ORA-01089: immediate shutdown in progress - no o
> perations are permitted
>         at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport
> .java:45)
>         at org.apache.activemq.store.jdbc.TransactionContext.close(TransactionCo
> ntext.java:141)
>         at org.apache.activemq.store.jdbc.JDBCMessageStore.addMessage(JDBCMessag
> eStore.java:129)
>         at org.apache.activemq.store.memory.MemoryTransactionStore.addMessage(Me
> moryTransactionStore.java:327)
>         at org.apache.activemq.store.memory.MemoryTransactionStore$2.asyncAddTop
> icMessage(MemoryTransactionStore.java:190)
>         at org.apache.activemq.broker.region.Topic.doMessageSend(Topic.java:471)
>         at org.apache.activemq.broker.region.Topic.send(Topic.java:435)
>         at org.apache.activemq.broker.region.AbstractRegion.send(AbstractRegion.
> java:406)
>         at org.apache.activemq.broker.region.RegionBroker.send(RegionBroker.java
> :392)
>         at org.apache.activemq.broker.jmx.ManagedRegionBroker.send(ManagedRegion
> Broker.java:282)
>         at org.apache.activemq.broker.BrokerFilter.send(BrokerFilter.java:129)
>         at org.apache.activemq.broker.CompositeDestinationBroker.send(CompositeD
> estinationBroker.java:96)
>         at org.apache.activemq.broker.TransactionBroker.send(TransactionBroker.j
> ava:317)
>         at org.apache.activemq.broker.MutableBrokerFilter.send(MutableBrokerFilt
> er.java:135)
>         at org.apache.activemq.broker.TransportConnection.processMessage(Transpo
> rtConnection.java:499)
>         at org.apache.activemq.command.ActiveMQMessage.visit(ActiveMQMessage.jav
> a:749)
>         at org.apache.activemq.broker.TransportConnection.service(TransportConne
> ction.java:329)
>         at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportC
> onnection.java:184)
>         at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport
> .java:50)
>         at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireForm
> atNegotiator.java:113)
>         at org.apache.activemq.transport.AbstractInactivityMonitor.onCommand(Abs
> tractInactivityMonitor.java:288)
>         at org.apache.activemq.transport.TransportSupport.doConsume(TransportSup
> port.java:83)
>         at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.jav
> a:214)
>         at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:
> 196)
>         ... 1 more
> Caused by: java.lang.Throwable: java.sql.BatchUpdateException: ORA-01089: immedi
> ate shutdown in progress - no operations are permitted
>         at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePrepare
> dStatement.java:10296)
>         at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatemen
> tWrapper.java:216)
>         at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewPr
> oxyPreparedStatement.java:1723)
>         at org.apache.activemq.store.jdbc.TransactionContext.executeBatch(Transa
> ctionContext.java:106)
>         at org.apache.activemq.store.jdbc.TransactionContext.executeBatch(Transa
> ctionContext.java:84)
>         at org.apache.activemq.store.jdbc.TransactionContext.close(TransactionCo
> ntext.java:132)
> {code}
> Will attach a test case soon.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message