camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <>
Subject [jira] [Resolved] (CAMEL-6097) Race condition in AggregatorProcessor recovery sometimes causes duplicates
Date Fri, 01 Mar 2013 09:51:13 GMT


Claus Ibsen resolved CAMEL-6097.

    Resolution: Fixed

Thanks for reporting, and providing ideas for a solution.
> Race condition in AggregatorProcessor recovery sometimes causes duplicates
> --------------------------------------------------------------------------
>                 Key: CAMEL-6097
>                 URL:
>             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:

View raw message