CAMEL-8010:Reverted previous push since AggregatorLockingTest failed

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/094af056
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/094af056
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/094af056

Branch: refs/heads/master
Commit: 094af056c73dc747781fbf1f3279bc43dc1361cf
Parents: 203fcf4
Author: Rajithamol <[email protected]>
Authored: Fri Aug 18 15:55:13 2017 -0400
Committer: Andrea Cosentino <[email protected]>
Committed: Thu Aug 24 11:18:47 2017 +0200

----------------------------------------------------------------------
 .../camel/processor/aggregate/AggregateProcessor.java | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/094af056/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
 
b/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
index e438543..c05b970 100644
--- 
a/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
+++ 
b/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
@@ -346,16 +346,16 @@ public class AggregateProcessor extends ServiceSupport 
implements AsyncProcessor
             lock.lock();
             try {
                 aggregated = doAggregation(key, copy);
-                // we are completed so submit to completion
-                if (aggregated != null) {
-                    for (Exchange agg : aggregated) {
-                        onSubmitCompletion(key, agg);
-                    }
-                }
+
             } finally {
                 lock.unlock();
             }
-
+            // we are completed so do that work outside the lock
+            if (aggregated != null) {
+                for (Exchange agg : aggregated) {
+                    onSubmitCompletion(key, agg);
+                }
+            }
         }
 
         // check for the special header to force completion of all groups 
(inclusive of the message)

Reply via email to