You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Mathieu Baril (JIRA)" <ji...@apache.org> on 2008/01/25 19:33:25 UTC

[jira] Created: (AMQ-1569) Dead lock during XA recovery when activeMq 5.0.0 is used with Atomikos

Dead lock during XA recovery when activeMq 5.0.0 is used with Atomikos
----------------------------------------------------------------------

                 Key: AMQ-1569
                 URL: https://issues.apache.org/activemq/browse/AMQ-1569
             Project: ActiveMQ
          Issue Type: Bug
    Affects Versions: 5.0.0
            Reporter: Mathieu Baril


Hi,

I developed an application that runs in an OSGI environment (Equinox). My application is developed using Spring Dynamic Modules 1.0-rc2, ActiveMq 5.0.0 and Atomikos 3.2.2.

Sometimes (50% of the time) when I start my application, the bundle that declare the connection factories to the jms broker runs into deadlock.

This is the declaration of my connection factories:

<bean id="activemq.connectionFactory" class="com.trilliantnetworks.griffin.utils.CustomXAJMSConnectionFactory">
    <property name="brokerURL" value=" failover:(tcp://software2:61616,tcp://software1:61616)" />
  </bean>
  
  <!-- Configure the JMS connector; call init to register for recovery! -->
  <bean id="atomikos.connectionFactory"
        class="com.atomikos.jms.TopicConnectionFactoryBean" init-method="init">
    <property name="resourceName" value=" jms.connectionFactory"/>
    <property name="xaTopicConnectionFactory" ref=" activemq.connectionFactory "/>
  </bean>
  
  <bean id="listen.jms.spring.singleConnectionFactory" class="org.springframework.jms.connection.SingleConnectionFactory" destroy-method="destroy">
    <constructor-arg ref="atomikos.connectionFactory "/>
  </bean>

Looking deeper in the code I found that the application block when init is called in com.atomikos.jms.TopicConnectionFactoryBean.

The init method calls the method isSameRM of org.apache.activemq.TransactionContext that eventually calls waitForBrokerInfo in org.apache.activemq.ActiveMQConnection. The method blocks on brokerInfoReceived.await(). So I tried to found why brokerInfoReceived.countDown() is never called...

I found that this is because createTransportListener of org.apache.activemq.transport.failover.FailoverTransport is sometimes called before the member variable transportListener was set. createTransportListener is called by the Thread ActiveMQ Transport: tcp://software2/192.9.200.182:61616 while setTransportListener is called by the main Thread that initialize my bundle.

I am unable to reproduce the issue with activeMQ 4.1.1 so I think that is issue has been introduced with version 5.0.0.

Also, when I use the connection URL "tcp://software2:61616" instead of "failover:(tcp://software2:61616,tcp://software1:61616)" my application always start correctly.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-1569) Dead lock during XA recovery when activeMq 5.0.0 is used with Atomikos

Posted by "Augusto Rodriguez (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43560#action_43560 ] 

Augusto Rodriguez commented on AMQ-1569:
----------------------------------------

Hi, 

We're experiencing the same problem with ActiveMQ 5.1 (using a ActiveMQXAConnectionFactory) and Atomikos 3.2.3. 

Cheers,
Augusto

> Dead lock during XA recovery when activeMq 5.0.0 is used with Atomikos
> ----------------------------------------------------------------------
>
>                 Key: AMQ-1569
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1569
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.0.0
>            Reporter: Mathieu Baril
>
> Hi,
> I developed an application that runs in an OSGI environment (Equinox). My application is developed using Spring Dynamic Modules 1.0-rc2, ActiveMq 5.0.0 and Atomikos 3.2.2.
> Sometimes (50% of the time) when I start my application, the bundle that declare the connection factories to the jms broker runs into deadlock.
> This is the declaration of my connection factories:
> <bean id="activemq.connectionFactory" class="com.trilliantnetworks.griffin.utils.CustomXAJMSConnectionFactory">
>     <property name="brokerURL" value=" failover:(tcp://software2:61616,tcp://software1:61616)" />
>   </bean>
>   
>   <!-- Configure the JMS connector; call init to register for recovery! -->
>   <bean id="atomikos.connectionFactory"
>         class="com.atomikos.jms.TopicConnectionFactoryBean" init-method="init">
>     <property name="resourceName" value=" jms.connectionFactory"/>
>     <property name="xaTopicConnectionFactory" ref=" activemq.connectionFactory "/>
>   </bean>
>   
>   <bean id="listen.jms.spring.singleConnectionFactory" class="org.springframework.jms.connection.SingleConnectionFactory" destroy-method="destroy">
>     <constructor-arg ref="atomikos.connectionFactory "/>
>   </bean>
> Looking deeper in the code I found that the application block when init is called in com.atomikos.jms.TopicConnectionFactoryBean.
> The init method calls the method isSameRM of org.apache.activemq.TransactionContext that eventually calls waitForBrokerInfo in org.apache.activemq.ActiveMQConnection. The method blocks on brokerInfoReceived.await(). So I tried to found why brokerInfoReceived.countDown() is never called...
> I found that this is because createTransportListener of org.apache.activemq.transport.failover.FailoverTransport is sometimes called before the member variable transportListener was set. createTransportListener is called by the Thread ActiveMQ Transport: tcp://software2/192.9.200.182:61616 while setTransportListener is called by the main Thread that initialize my bundle.
> I am unable to reproduce the issue with activeMQ 4.1.1 so I think that is issue has been introduced with version 5.0.0.
> Also, when I use the connection URL "tcp://software2:61616" instead of "failover:(tcp://software2:61616,tcp://software1:61616)" my application always start correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-1569) Dead lock during XA recovery when activeMq 5.0.0 is used with Atomikos

Posted by "Augusto Rodriguez (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43619#action_43619 ] 

Augusto Rodriguez commented on AMQ-1569:
----------------------------------------

It looks like this issue was fixed by AMQ-1771

> Dead lock during XA recovery when activeMq 5.0.0 is used with Atomikos
> ----------------------------------------------------------------------
>
>                 Key: AMQ-1569
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1569
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.0.0
>            Reporter: Mathieu Baril
>
> Hi,
> I developed an application that runs in an OSGI environment (Equinox). My application is developed using Spring Dynamic Modules 1.0-rc2, ActiveMq 5.0.0 and Atomikos 3.2.2.
> Sometimes (50% of the time) when I start my application, the bundle that declare the connection factories to the jms broker runs into deadlock.
> This is the declaration of my connection factories:
> <bean id="activemq.connectionFactory" class="com.trilliantnetworks.griffin.utils.CustomXAJMSConnectionFactory">
>     <property name="brokerURL" value=" failover:(tcp://software2:61616,tcp://software1:61616)" />
>   </bean>
>   
>   <!-- Configure the JMS connector; call init to register for recovery! -->
>   <bean id="atomikos.connectionFactory"
>         class="com.atomikos.jms.TopicConnectionFactoryBean" init-method="init">
>     <property name="resourceName" value=" jms.connectionFactory"/>
>     <property name="xaTopicConnectionFactory" ref=" activemq.connectionFactory "/>
>   </bean>
>   
>   <bean id="listen.jms.spring.singleConnectionFactory" class="org.springframework.jms.connection.SingleConnectionFactory" destroy-method="destroy">
>     <constructor-arg ref="atomikos.connectionFactory "/>
>   </bean>
> Looking deeper in the code I found that the application block when init is called in com.atomikos.jms.TopicConnectionFactoryBean.
> The init method calls the method isSameRM of org.apache.activemq.TransactionContext that eventually calls waitForBrokerInfo in org.apache.activemq.ActiveMQConnection. The method blocks on brokerInfoReceived.await(). So I tried to found why brokerInfoReceived.countDown() is never called...
> I found that this is because createTransportListener of org.apache.activemq.transport.failover.FailoverTransport is sometimes called before the member variable transportListener was set. createTransportListener is called by the Thread ActiveMQ Transport: tcp://software2/192.9.200.182:61616 while setTransportListener is called by the main Thread that initialize my bundle.
> I am unable to reproduce the issue with activeMQ 4.1.1 so I think that is issue has been introduced with version 5.0.0.
> Also, when I use the connection URL "tcp://software2:61616" instead of "failover:(tcp://software2:61616,tcp://software1:61616)" my application always start correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.