[jboss-cvs] JBoss Messaging SVN: r6071 - trunk/src/main/org/jboss/messaging/core/postoffice/impl.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Mar 12 14:42:59 EDT 2009


Author: clebert.suconic at jboss.com
Date: 2009-03-12 14:42:59 -0400 (Thu, 12 Mar 2009)
New Revision: 6071

Modified:
   trunk/src/main/org/jboss/messaging/core/postoffice/impl/BindingsImpl.java
Log:
https://jira.jboss.org/jira/browse/JBMESSAGING-1545 - an attempt to fix the infinite loop.
(this is not a final solution.. just trying to get some runs our of hudson)

Modified: trunk/src/main/org/jboss/messaging/core/postoffice/impl/BindingsImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/postoffice/impl/BindingsImpl.java	2009-03-12 14:38:21 UTC (rev 6070)
+++ trunk/src/main/org/jboss/messaging/core/postoffice/impl/BindingsImpl.java	2009-03-12 18:42:59 UTC (rev 6071)
@@ -298,7 +298,10 @@
                Binding theBinding = null;
 
                int lastLowPriorityBinding = -1;
+               
+               int nonMatchingFilters = 0;
 
+
                while (true)
                {
                   Binding binding;
@@ -308,10 +311,16 @@
                   }
                   catch (IndexOutOfBoundsException e)
                   {
+                     if (nonMatchingFilters == bindings.size())
+                     {
+                        break;
+                     }
+                     
                      // This can occur if binding is removed while in route
                      if (!bindings.isEmpty())
                      {
                         pos = 0;
+                        nonMatchingFilters = 0;
 
                         continue;
                      }
@@ -343,6 +352,13 @@
                         }
                      }
                   }
+                  else
+                  {
+                     if (nonMatchingFilters++ > bindings.size())
+                     {
+                        break;
+                     }
+                  }
 
                   pos = incrementPos(pos, length);
 




More information about the jboss-cvs-commits mailing list