You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Siim Kaalep (JIRA)" <ji...@apache.org> on 2010/06/10 10:43:51 UTC

[jira] Created: (AMQ-2772) ActiveMQConnectionConsumer will break failover

ActiveMQConnectionConsumer will break failover
----------------------------------------------

                 Key: AMQ-2772
                 URL: https://issues.apache.org/activemq/browse/AMQ-2772
             Project: ActiveMQ
          Issue Type: Bug
          Components: Connector
    Affects Versions: 5.3.2
            Reporter: Siim Kaalep


ActiveMQConnection.transportInterupted assumes that
dispatchers.size() == all session's consumers + one advisoryConsumer

But ActiveMQConnectionConsumer also registers itself as dispatcher in constructor.

On failover attempt connection will remain in waiting state. 
Logging "dispatch paused, waiting for outstanding dispatch interruption processing (1) to complete.."

ActiveMQConnectionConsumer is used in ActiveMQ resource adapter in ActiveMQEndpointWorker.


Robust fix:

Index: trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
===================================================================
--- trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
+++ trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
@@ -1840,7 +1840,7 @@
 	}
 
     public void transportInterupted() {
-        transportInterruptionProcessingComplete = new CountDownLatch(dispatchers.size() - (advisoryConsumer != null ? 1:0));
+        transportInterruptionProcessingComplete = new CountDownLatch(dispatchers.size() - (advisoryConsumer != null ? 1:0) - connectionConsumers.size());
         if (LOG.isDebugEnabled()) {
             LOG.debug("transport interrupted, dispatchers: " + transportInterruptionProcessingComplete.getCount());
         }


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


[jira] Resolved: (AMQ-2772) ActiveMQConnectionConsumer will break failover

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Tully resolved AMQ-2772.
-----------------------------

    Fix Version/s: 5.4.0
       Resolution: Fixed

patch applied to r953696 with an additional test case. We may need some additional MDB tests that validate transaction semantics in the event of failover and no redelivery but the existing rollback logic with a timeout should suffice.
In any event, this change will prevent the block with was just plain wrong. nice catch, thanks.

> ActiveMQConnectionConsumer will break failover
> ----------------------------------------------
>
>                 Key: AMQ-2772
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2772
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Connector
>    Affects Versions: 5.3.2
>            Reporter: Siim Kaalep
>            Assignee: Gary Tully
>             Fix For: 5.4.0
>
>
> ActiveMQConnection.transportInterupted assumes that
> dispatchers.size() == all session's consumers + one advisoryConsumer
> But ActiveMQConnectionConsumer also registers itself as dispatcher in constructor.
> On failover attempt connection will remain in waiting state. 
> Logging "dispatch paused, waiting for outstanding dispatch interruption processing (1) to complete.."
> ActiveMQConnectionConsumer is used in ActiveMQ resource adapter in ActiveMQEndpointWorker.
> Robust fix:
> {noformat} 
> Index: trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
> ===================================================================
> --- trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
> +++ trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
> @@ -1840,7 +1840,7 @@
>  	}
>  
>      public void transportInterupted() {
> -        transportInterruptionProcessingComplete = new CountDownLatch(dispatchers.size() - (advisoryConsumer != null ? 1:0));
> +        transportInterruptionProcessingComplete = new CountDownLatch(dispatchers.size() - (advisoryConsumer != null ? 1:0) - connectionConsumers.size());
>          if (LOG.isDebugEnabled()) {
>              LOG.debug("transport interrupted, dispatchers: " + transportInterruptionProcessingComplete.getCount());
>          }
> {noformat} 

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


[jira] Assigned: (AMQ-2772) ActiveMQConnectionConsumer will break failover

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Tully reassigned AMQ-2772:
-------------------------------

    Assignee: Gary Tully

> ActiveMQConnectionConsumer will break failover
> ----------------------------------------------
>
>                 Key: AMQ-2772
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2772
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Connector
>    Affects Versions: 5.3.2
>            Reporter: Siim Kaalep
>            Assignee: Gary Tully
>
> ActiveMQConnection.transportInterupted assumes that
> dispatchers.size() == all session's consumers + one advisoryConsumer
> But ActiveMQConnectionConsumer also registers itself as dispatcher in constructor.
> On failover attempt connection will remain in waiting state. 
> Logging "dispatch paused, waiting for outstanding dispatch interruption processing (1) to complete.."
> ActiveMQConnectionConsumer is used in ActiveMQ resource adapter in ActiveMQEndpointWorker.
> Robust fix:
> {noformat} 
> Index: trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
> ===================================================================
> --- trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
> +++ trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
> @@ -1840,7 +1840,7 @@
>  	}
>  
>      public void transportInterupted() {
> -        transportInterruptionProcessingComplete = new CountDownLatch(dispatchers.size() - (advisoryConsumer != null ? 1:0));
> +        transportInterruptionProcessingComplete = new CountDownLatch(dispatchers.size() - (advisoryConsumer != null ? 1:0) - connectionConsumers.size());
>          if (LOG.isDebugEnabled()) {
>              LOG.debug("transport interrupted, dispatchers: " + transportInterruptionProcessingComplete.getCount());
>          }
> {noformat} 

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


[jira] Updated: (AMQ-2772) ActiveMQConnectionConsumer will break failover

Posted by "Siim Kaalep (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Siim Kaalep updated AMQ-2772:
-----------------------------

    Description: 
ActiveMQConnection.transportInterupted assumes that
dispatchers.size() == all session's consumers + one advisoryConsumer

But ActiveMQConnectionConsumer also registers itself as dispatcher in constructor.

On failover attempt connection will remain in waiting state. 
Logging "dispatch paused, waiting for outstanding dispatch interruption processing (1) to complete.."

ActiveMQConnectionConsumer is used in ActiveMQ resource adapter in ActiveMQEndpointWorker.


Robust fix:
{noformat} 
Index: trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
===================================================================
--- trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
+++ trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
@@ -1840,7 +1840,7 @@
 	}
 
     public void transportInterupted() {
-        transportInterruptionProcessingComplete = new CountDownLatch(dispatchers.size() - (advisoryConsumer != null ? 1:0));
+        transportInterruptionProcessingComplete = new CountDownLatch(dispatchers.size() - (advisoryConsumer != null ? 1:0) - connectionConsumers.size());
         if (LOG.isDebugEnabled()) {
             LOG.debug("transport interrupted, dispatchers: " + transportInterruptionProcessingComplete.getCount());
         }
{noformat} 

  was:
ActiveMQConnection.transportInterupted assumes that
dispatchers.size() == all session's consumers + one advisoryConsumer

But ActiveMQConnectionConsumer also registers itself as dispatcher in constructor.

On failover attempt connection will remain in waiting state. 
Logging "dispatch paused, waiting for outstanding dispatch interruption processing (1) to complete.."

ActiveMQConnectionConsumer is used in ActiveMQ resource adapter in ActiveMQEndpointWorker.


Robust fix:

Index: trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
===================================================================
--- trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
+++ trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
@@ -1840,7 +1840,7 @@
 	}
 
     public void transportInterupted() {
-        transportInterruptionProcessingComplete = new CountDownLatch(dispatchers.size() - (advisoryConsumer != null ? 1:0));
+        transportInterruptionProcessingComplete = new CountDownLatch(dispatchers.size() - (advisoryConsumer != null ? 1:0) - connectionConsumers.size());
         if (LOG.isDebugEnabled()) {
             LOG.debug("transport interrupted, dispatchers: " + transportInterruptionProcessingComplete.getCount());
         }



> ActiveMQConnectionConsumer will break failover
> ----------------------------------------------
>
>                 Key: AMQ-2772
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2772
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Connector
>    Affects Versions: 5.3.2
>            Reporter: Siim Kaalep
>
> ActiveMQConnection.transportInterupted assumes that
> dispatchers.size() == all session's consumers + one advisoryConsumer
> But ActiveMQConnectionConsumer also registers itself as dispatcher in constructor.
> On failover attempt connection will remain in waiting state. 
> Logging "dispatch paused, waiting for outstanding dispatch interruption processing (1) to complete.."
> ActiveMQConnectionConsumer is used in ActiveMQ resource adapter in ActiveMQEndpointWorker.
> Robust fix:
> {noformat} 
> Index: trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
> ===================================================================
> --- trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
> +++ trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
> @@ -1840,7 +1840,7 @@
>  	}
>  
>      public void transportInterupted() {
> -        transportInterruptionProcessingComplete = new CountDownLatch(dispatchers.size() - (advisoryConsumer != null ? 1:0));
> +        transportInterruptionProcessingComplete = new CountDownLatch(dispatchers.size() - (advisoryConsumer != null ? 1:0) - connectionConsumers.size());
>          if (LOG.isDebugEnabled()) {
>              LOG.debug("transport interrupted, dispatchers: " + transportInterruptionProcessingComplete.getCount());
>          }
> {noformat} 

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