Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.7.3
-
None
-
Unknown
Description
If you have routes that have nested enrichers that use shareUnitOfWork=true, you'll get a ConcurrentModificationException when the subroutes are joined back.
from("direct:routeA"). enrichWith("direct:routeB", true, true).body((a, b) -> a); from("direct:routeB"). enrichWith("direct:routeC", true, true).body((a, b) -> a); from("direct:routeC").setBody(constant("xxx"));
org.apache.camel.CamelExchangeException: Error occurred during aggregation. Exchange[0A01B3DD98090F3-0000000000000001]. Caused by: [java.util.ConcurrentModificationException - null]
at org.apache.camel.processor.Enricher$1.done(Enricher.java:247) ~[camel-core-processor-3.7.3.jar:3.7.3]
at org.apache.camel.AsyncCallback.run(AsyncCallback.java:44) ~[camel-api-3.7.3.jar:3.7.3]
...
Caused by: java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1042) ~[?:?]
at java.util.ArrayList$Itr.remove(ArrayList.java:1010) ~[?:?]
at org.apache.camel.impl.engine.DefaultUnitOfWork.handoverSynchronization(DefaultUnitOfWork.java:202) ~[camel-base-engine-3.7.3.jar:3.7.3]
at org.apache.camel.impl.engine.DefaultUnitOfWork.handoverSynchronization(DefaultUnitOfWork.java:179) ~[camel-base-engine-3.7.3.jar:3.7.3]
at org.apache.camel.support.DefaultExchange.handoverCompletions(DefaultExchange.java:612) ~[camel-support-3.7.3.jar:3.7.3]
at org.apache.camel.processor.Enricher$1.done(Enricher.java:242) ~[camel-core-processor-3.7.3.jar:3.7.3]
...