You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Nikolaos Dimos (Created) (JIRA)" <ji...@apache.org> on 2012/03/08 17:49:57 UTC

[jira] [Created] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Message Loss when using Weighted Round Robin LoadBalancer
---------------------------------------------------------

                 Key: CAMEL-5070
                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
             Project: Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.9.1
            Reporter: Nikolaos Dimos
         Attachments: loadbalancer-itest.zip

chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
 
The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Posted by "Nikolaos Dimos (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13226801#comment-13226801 ] 

Nikolaos Dimos commented on CAMEL-5070:
---------------------------------------

Thanks Ashwin and Claus.
                
> Message Loss when using Weighted Round Robin LoadBalancer
> ---------------------------------------------------------
>
>                 Key: CAMEL-5070
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.1
>            Reporter: Nikolaos Dimos
>            Assignee: Ashwin Karpe
>             Fix For: 2.8.5, 2.10.0, 2.9.2
>
>         Attachments: loadbalancer-itest.zip
>
>
> chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
>  
> The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Work started] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Posted by "Ashwin Karpe (Work started) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on CAMEL-5070 started by Ashwin Karpe.

> Message Loss when using Weighted Round Robin LoadBalancer
> ---------------------------------------------------------
>
>                 Key: CAMEL-5070
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.1
>            Reporter: Nikolaos Dimos
>            Assignee: Ashwin Karpe
>         Attachments: loadbalancer-itest.zip
>
>
> chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
>  
> The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Posted by "Claus Ibsen (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-5070:
-------------------------------

    Patch Info:   (was: Patch Available)
    
> Message Loss when using Weighted Round Robin LoadBalancer
> ---------------------------------------------------------
>
>                 Key: CAMEL-5070
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.1
>            Reporter: Nikolaos Dimos
>         Attachments: loadbalancer-itest.zip
>
>
> chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
>  
> The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Posted by "Ashwin Karpe (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13226354#comment-13226354 ] 

Ashwin Karpe edited comment on CAMEL-5070 at 3/9/12 7:26 PM:
-------------------------------------------------------------

Applied fix to trunk as revision r1298993.

Thanks to Nikolaus Dims for providing the patch.

- Ashwin...
                
      was (Author: akarpe):
    Applied fix to trunk as revision r1298993.

- Ashwin...
                  
> Message Loss when using Weighted Round Robin LoadBalancer
> ---------------------------------------------------------
>
>                 Key: CAMEL-5070
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.1
>            Reporter: Nikolaos Dimos
>            Assignee: Ashwin Karpe
>         Attachments: loadbalancer-itest.zip
>
>
> chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
>  
> The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Posted by "Claus Ibsen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13226799#comment-13226799 ] 

Claus Ibsen commented on CAMEL-5070:
------------------------------------

See the asyncConsumer option on the JMS component
http://camel.apache.org/jms
                
> Message Loss when using Weighted Round Robin LoadBalancer
> ---------------------------------------------------------
>
>                 Key: CAMEL-5070
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.1
>            Reporter: Nikolaos Dimos
>            Assignee: Ashwin Karpe
>             Fix For: 2.8.5, 2.10.0, 2.9.2
>
>         Attachments: loadbalancer-itest.zip
>
>
> chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
>  
> The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Posted by "Ashwin Karpe (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13226354#comment-13226354 ] 

Ashwin Karpe edited comment on CAMEL-5070 at 3/9/12 9:54 PM:
-------------------------------------------------------------

Applied fix to trunk as revision r1298993.

Thanks to Nikolaos Dimos for providing the patch.

- Ashwin...
                
      was (Author: akarpe):
    Applied fix to trunk as revision r1298993.

Thanks to Nikolaus Dimos for providing the patch.

- Ashwin...
                  
> Message Loss when using Weighted Round Robin LoadBalancer
> ---------------------------------------------------------
>
>                 Key: CAMEL-5070
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.1
>            Reporter: Nikolaos Dimos
>            Assignee: Ashwin Karpe
>         Attachments: loadbalancer-itest.zip
>
>
> chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
>  
> The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Work stopped] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Posted by "Ashwin Karpe (Work stopped) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on CAMEL-5070 stopped by Ashwin Karpe.

> Message Loss when using Weighted Round Robin LoadBalancer
> ---------------------------------------------------------
>
>                 Key: CAMEL-5070
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.1
>            Reporter: Nikolaos Dimos
>            Assignee: Ashwin Karpe
>         Attachments: loadbalancer-itest.zip
>
>
> chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
>  
> The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Posted by "Ashwin Karpe (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13226305#comment-13226305 ] 

Ashwin Karpe commented on CAMEL-5070:
-------------------------------------

Hi Nikos,

Excellent... I will make the fix right away, test, and check it in.

Thanks for your help in identifying the issue and providing the patch...

Cheers,

Ashwin...
                
> Message Loss when using Weighted Round Robin LoadBalancer
> ---------------------------------------------------------
>
>                 Key: CAMEL-5070
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.1
>            Reporter: Nikolaos Dimos
>            Assignee: Ashwin Karpe
>         Attachments: loadbalancer-itest.zip
>
>
> chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
>  
> The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Posted by "Ashwin Karpe (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashwin Karpe resolved CAMEL-5070.
---------------------------------

    Resolution: Fixed

Applied fix to trunk as revision r1298993.

- Ashwin...
                
> Message Loss when using Weighted Round Robin LoadBalancer
> ---------------------------------------------------------
>
>                 Key: CAMEL-5070
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.1
>            Reporter: Nikolaos Dimos
>            Assignee: Ashwin Karpe
>         Attachments: loadbalancer-itest.zip
>
>
> chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
>  
> The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Posted by "Claus Ibsen (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-5070:
-------------------------------

    Fix Version/s: 2.9.2
                   2.10.0
                   2.8.5
    
> Message Loss when using Weighted Round Robin LoadBalancer
> ---------------------------------------------------------
>
>                 Key: CAMEL-5070
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.1
>            Reporter: Nikolaos Dimos
>            Assignee: Ashwin Karpe
>             Fix For: 2.8.5, 2.10.0, 2.9.2
>
>         Attachments: loadbalancer-itest.zip
>
>
> chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
>  
> The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Posted by "Nikolaos Dimos (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13226109#comment-13226109 ] 

Nikolaos Dimos commented on CAMEL-5070:
---------------------------------------

Weighted Round Robin Loadbalancer should be synchronized. The custom loadbalancer provided in the integration test does exactly this. It solves the problem of the index out of bound exception:

Caused by: java.lang.ArrayIndexOutOfBoundsException: 3
        at java.util.concurrent.CopyOnWriteArrayList.get(CopyOnWriteArrayList.java:343)[:1.6.0_20]
        at org.apache.camel.processor.loadbalancer.WeightedRoundRobinLoadBalancer.chooseProcessor(WeightedRoundRobinLoadBalancer.java:52)[71:org.apache.camel.camel-core:2.9.0]
        at org.apache.camel.processor.loadbalancer.QueueLoadBalancer.process(QueueLoadBalancer.java:39)[71:org.apache.camel.camel-core:2.9.0]
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[71:org.apache.camel.camel-core:2.9.0]
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[71:org.apache.camel.camel-core:2.9.0]

Nevertheless, if you follow this approach jms consumers of queue1, queue2 and queue3 block. If you try to loadbalance a large amount of messages from the first queue to the other 3, using the synchronized weighted round robin loadbalancer, then you will see that the queues (queue1,2 and 3) are growing without obvious to me reason. The second route is only from jms to log.
                
> Message Loss when using Weighted Round Robin LoadBalancer
> ---------------------------------------------------------
>
>                 Key: CAMEL-5070
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.1
>            Reporter: Nikolaos Dimos
>         Attachments: loadbalancer-itest.zip
>
>
> chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
>  
> The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Posted by "Ashwin Karpe (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13226306#comment-13226306 ] 

Ashwin Karpe commented on CAMEL-5070:
-------------------------------------

Hi Nikos,

Excellent... I will make the fix right away, test, and check it in.

Thanks for your help in identifying the issue and providing the patch...

Cheers,

Ashwin...
                
> Message Loss when using Weighted Round Robin LoadBalancer
> ---------------------------------------------------------
>
>                 Key: CAMEL-5070
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.1
>            Reporter: Nikolaos Dimos
>            Assignee: Ashwin Karpe
>         Attachments: loadbalancer-itest.zip
>
>
> chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
>  
> The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Posted by "Ashwin Karpe (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13226148#comment-13226148 ] 

Ashwin Karpe commented on CAMEL-5070:
-------------------------------------

Hi Nikos,

I can see the scenario you are mentioning happening under load where the counter may get out of synch under load...

I am however unclear on the queues growing without reason issue. Do you mean there are additional messages being created and dispatched to the queues.

Cheers,

Ashwin...
                
> Message Loss when using Weighted Round Robin LoadBalancer
> ---------------------------------------------------------
>
>                 Key: CAMEL-5070
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.1
>            Reporter: Nikolaos Dimos
>            Assignee: Ashwin Karpe
>         Attachments: loadbalancer-itest.zip
>
>
> chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
>  
> The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Posted by "Ashwin Karpe (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13226354#comment-13226354 ] 

Ashwin Karpe edited comment on CAMEL-5070 at 3/9/12 9:54 PM:
-------------------------------------------------------------

Applied fix to trunk as revision r1298993.

Thanks to Nikolaus Dimos for providing the patch.

- Ashwin...
                
      was (Author: akarpe):
    Applied fix to trunk as revision r1298993.

Thanks to Nikolaus Dims for providing the patch.

- Ashwin...
                  
> Message Loss when using Weighted Round Robin LoadBalancer
> ---------------------------------------------------------
>
>                 Key: CAMEL-5070
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.1
>            Reporter: Nikolaos Dimos
>            Assignee: Ashwin Karpe
>         Attachments: loadbalancer-itest.zip
>
>
> chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
>  
> The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Posted by "Ashwin Karpe (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashwin Karpe reassigned CAMEL-5070:
-----------------------------------

    Assignee: Ashwin Karpe
    
> Message Loss when using Weighted Round Robin LoadBalancer
> ---------------------------------------------------------
>
>                 Key: CAMEL-5070
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.1
>            Reporter: Nikolaos Dimos
>            Assignee: Ashwin Karpe
>         Attachments: loadbalancer-itest.zip
>
>
> chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
>  
> The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Posted by "Ashwin Karpe (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13226148#comment-13226148 ] 

Ashwin Karpe edited comment on CAMEL-5070 at 3/9/12 3:49 PM:
-------------------------------------------------------------

Hi Nikos,

I can see the scenario you are mentioning happening under load where the counter and/or runtimeWeight may get out of synch under load...

I am however unclear on the queues growing without reason issue. Do you mean there are additional messages being created and dispatched to the queues.

Can you remove the synchronized on the chooseProcessor() method and synchronize just the counter and runtimeWeight and see if there is a change in behavior. 

Cheers,

Ashwin...
                
      was (Author: akarpe):
    Hi Nikos,

I can see the scenario you are mentioning happening under load where the counter and/or runtimeWeight may get out of synch under load...

I am however unclear on the queues growing without reason issue. Do you mean there are additional messages being created and dispatched to the queues.

Cheers,

Ashwin...
                  
> Message Loss when using Weighted Round Robin LoadBalancer
> ---------------------------------------------------------
>
>                 Key: CAMEL-5070
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.1
>            Reporter: Nikolaos Dimos
>            Assignee: Ashwin Karpe
>         Attachments: loadbalancer-itest.zip
>
>
> chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
>  
> The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Posted by "Nikolaos Dimos (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13225315#comment-13225315 ] 

Nikolaos Dimos commented on CAMEL-5070:
---------------------------------------

You can reproduce the problem by uncommenting the weightedRoundRobin line in the custom-loadbalancer-route subproject (and commenting of course the custom). The custom karaf command that was implemented (queue:broker-info) provides the following information QName|QConsumerCount|QSize|QEnqueueCount|QDequeueCount.
                
> Message Loss when using Weighted Round Robin LoadBalancer
> ---------------------------------------------------------
>
>                 Key: CAMEL-5070
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.1
>            Reporter: Nikolaos Dimos
>         Attachments: loadbalancer-itest.zip
>
>
> chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
>  
> The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Posted by "Nikolaos Dimos (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13226289#comment-13226289 ] 

Nikolaos Dimos commented on CAMEL-5070:
---------------------------------------

Hi Ashwin,

The provided sync load balancer solves the issue of lost messages. If you check the itest subproject you will see that the number of messages enqueued to initial route is the same as the sum of the messages dequeued from the three queues. I am not implying that additional messages are being created and dispatched to queues.

I believe that the whole process of chooseprocessor should be atomic not just the access to counter shared resource or weights, that is why I synched the whole method.

I have profiled the plain weighted round robin loadbalancer and experienced the same behaviour in terms of blocking jmsconsumer threads of all queues, so maybe this is the normal behavior. Sorry for not having done this before.

Thanks,
Nikos
                
> Message Loss when using Weighted Round Robin LoadBalancer
> ---------------------------------------------------------
>
>                 Key: CAMEL-5070
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.1
>            Reporter: Nikolaos Dimos
>            Assignee: Ashwin Karpe
>         Attachments: loadbalancer-itest.zip
>
>
> chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
>  
> The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Posted by "Claus Ibsen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13226090#comment-13226090 ] 

Claus Ibsen commented on CAMEL-5070:
------------------------------------

Which jms consumer is blocked?
And what is your problem exactly?

Can you post some more details. 
                
> Message Loss when using Weighted Round Robin LoadBalancer
> ---------------------------------------------------------
>
>                 Key: CAMEL-5070
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.1
>            Reporter: Nikolaos Dimos
>         Attachments: loadbalancer-itest.zip
>
>
> chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
>  
> The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Posted by "Ashwin Karpe (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13226148#comment-13226148 ] 

Ashwin Karpe edited comment on CAMEL-5070 at 3/9/12 3:41 PM:
-------------------------------------------------------------

Hi Nikos,

I can see the scenario you are mentioning happening under load where the counter and/or runtimeWeight may get out of synch under load...

I am however unclear on the queues growing without reason issue. Do you mean there are additional messages being created and dispatched to the queues.

Cheers,

Ashwin...
                
      was (Author: akarpe):
    Hi Nikos,

I can see the scenario you are mentioning happening under load where the counter may get out of synch under load...

I am however unclear on the queues growing without reason issue. Do you mean there are additional messages being created and dispatched to the queues.

Cheers,

Ashwin...
                  
> Message Loss when using Weighted Round Robin LoadBalancer
> ---------------------------------------------------------
>
>                 Key: CAMEL-5070
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.1
>            Reporter: Nikolaos Dimos
>            Assignee: Ashwin Karpe
>         Attachments: loadbalancer-itest.zip
>
>
> chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
>  
> The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Posted by "Nikolaos Dimos (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nikolaos Dimos updated CAMEL-5070:
----------------------------------

    Attachment: loadbalancer-itest.zip

Attaching the maven project that contains the camel route, the custom activemq commands and the itest subproject
                
> Message Loss when using Weighted Round Robin LoadBalancer
> ---------------------------------------------------------
>
>                 Key: CAMEL-5070
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.1
>            Reporter: Nikolaos Dimos
>         Attachments: loadbalancer-itest.zip
>
>
> chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
>  
> The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-5070) Message Loss when using Weighted Round Robin LoadBalancer

Posted by "Ashwin Karpe (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13226348#comment-13226348 ] 

Ashwin Karpe commented on CAMEL-5070:
-------------------------------------

Hi Nikos,

I have applied the fix to the trunk... 

https://svn.apache.org/viewvc?view=revision&revision=1298993

Thanks for identifying the issue and offering a patch for it.

Cheers,

Ashwin...
                
> Message Loss when using Weighted Round Robin LoadBalancer
> ---------------------------------------------------------
>
>                 Key: CAMEL-5070
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5070
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.1
>            Reporter: Nikolaos Dimos
>            Assignee: Ashwin Karpe
>         Attachments: loadbalancer-itest.zip
>
>
> chooseProcessor method accesses resources in a non synchronized fashion. This leads in errors during loadbalancing and as a result messages are lost. I have created a project that provides an integration test (using karaf 2.2.5 and a custom command to check messages of the activemq broker) with a custom weighted round robin loadbalancer that "seems" to solve the issue of lost messages.
>  
> The problem with the provided solution is that when messages are dequeued from the second stage of queues (queues1, 2 and 3) in custom-loadbalancer-route subproject the jmsconsumer threads also block (checked this using profiler). I would expect only the jmsconsumer threads of the first queue (initial.queue) to block waiting for the synchronized chooseProcessor method. Any clues on why this happens?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira