[ 
https://issues.apache.org/jira/browse/CAMEL-10215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15403050#comment-15403050
 ] 

ASF GitHub Bot commented on CAMEL-10215:
----------------------------------------

GitHub user ssharma opened a pull request:

    https://github.com/apache/camel/pull/1099

    https://issues.apache.org/jira/browse/CAMEL-10215 Synchronizing recei…

    Synchronizing EventDrivenPollingConsumer receive methods to make them 
thread safe when used with ConsumerCache

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ssharma/camel upstream

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/1099.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1099
    
----
commit eb0049ba5f0e3a377637e401a5a1c770a54b9bb4
Author: Siddharth Sharma <[email protected]>
Date:   2016-08-01T22:49:16Z

    https://issues.apache.org/jira/browse/CAMEL-10215 Synchronizing receive 
methods

----


> EventDrivenPollingConsumer is not thread safe when used with ConsumerCache 
> ---------------------------------------------------------------------------
>
>                 Key: CAMEL-10215
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10215
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.18.0
>            Reporter: Siddharth Sharma
>             Fix For: 2.18.0
>
>
> For static endpoints, if DefaultConsumerTemplate#receive() is used,  
> ConsumerCache will return the cached instance of PollingConsumer for every 
> thread part of parallel processing of split/aggregate.
> Now, if EventDrivenPollingConsumer is used, returning same cache instance 
> causes race condition in receive and receive(long) as the methods are not 
> thread safe. The ordering of beforePoll, poll and afterPoll needs to be 
> synchronized, otherwise the consumer might end up being suspended in 
> afterPoll and the client whose beforePoll couldn't wake up the suspended 
> thread will get no data.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to