You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2013/03/01 10:17:15 UTC

[jira] [Updated] (CAMEL-6097) Race condition in AggregatorProcessor recovery sometimes causes duplicates

     [ https://issues.apache.org/jira/browse/CAMEL-6097?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-6097:
-------------------------------

    Fix Version/s: 2.11.0
                   2.10.5
                   2.9.6
    
> Race condition in AggregatorProcessor recovery sometimes causes duplicates
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-6097
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6097
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.2
>            Reporter: Benjamin Truitt
>            Assignee: Claus Ibsen
>             Fix For: 2.9.6, 2.10.5, 2.11.0
>
>
> There seems to be a race condition in org.apache.camel.processor.aggregate.AggregateProcessor's RecoverTask.  That task calls recoverable.scan() to find Exchanges that may need to be recovered. Since scan() might return Exchanges that are actually just in progress, the RecoverTask then checks to see if the Exchange really is in progress.  It does this by calling inProgressCompleteExchanges.contains(exchangeId).  However, that collection may have been modified during the time between when scan() returned and when contains() is called.  This would happen if the in-progress Exchange completes before contains() is called.  In that situation, inProgress would evaluate to false, so the Exchange would be recovered.  This results in a duplicate Exchange being output by the Aggregator component. 
> One possible solution might be to prevent updating the inProgressCompleteExchanges during the critical section. Another possible solution might be to copy inProgressCompleteExchanges before calling scan().  I'm sure that there are other ways to deal with this also.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira