HornetQ hanging in setTransactionTimeout
jeremystone Mar 24, 2011 12:40 PMVery occassionally we have had strange behaviour where on sending a message to a topic, the thread hangs while setting the transaction timeout (see trace below). We're using HornetQ 2.1.2 and the client is in the local VM and is using the InVMConnector.
Basically no response is received to the send of the SessionXASetTimeoutMessage, so the thread waits until it eventually times out.
On receipt of the message the 'server' end of the session's xa timeout is set and the response is sent back using an IOAsyncTask passed to OperationContextImpl's executeOnCompletion(...). Given that some response is send back even when an exception is thrown, my only thought is that perhaps the OperationContextImpl instance is not processing tasks any more??
Have tried to debug but not got to the bottom of why it might happen (I'm not sure how to reproduce it). I notice that OperationContextImpl has had a finally block added to the Runnable in the execute method. Was this added to fix similar behaviour?
Any idead? Has anyone else seen this?
Stack dump from hanging thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2116)
org.hornetq.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:257)
org.hornetq.core.client.impl.ClientSessionImpl.setTransactionTimeout(ClientSessionImpl.java:1411)
org.hornetq.ra.HornetQRAXAResource.setTransactionTimeout(HornetQRAXAResource.java:241)
org.jboss.resource.connectionmanager.xa.JcaXAResourceWrapper.setTransactionTimeout(JcaXAResourceWrapper.java:108)
com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:750)
com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:497)
org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.enlist(TxConnectionManager.java:830)
org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:584)
org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:352)
org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:525)
org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:406)
org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:850)
org.hornetq.ra.HornetQRASessionFactoryImpl.allocateConnection(HornetQRASessionFactoryImpl.java:837)
org.hornetq.ra.HornetQRASessionFactoryImpl.createSession(HornetQRASessionFactoryImpl.java:470)
org.springframework.jms.support.JmsAccessor.createSession(JmsAccessor.java:196)
org.springframework.jms.core.JmsTemplate.access$1(JmsTemplate.java:1)
org.springframework.jms.core.JmsTemplate$JmsTemplateResourceFactory.createSession(JmsTemplate.java:1035)
org.springframework.jms.connection.ConnectionFactoryUtils.doGetTransactionalSession(ConnectionFactoryUtils.java:300)
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:453)
org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:543)