Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-16918

Datasonnet expression fails on first runs in a route called in multicast

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.11.1
    • 3.11.2, 3.12.0
    • camel-language
    • None
    • Unknown

    Description

      I use a multicast().parallelProcessing() that calls three routes that all use DataSonnet expressions. After starting the app the first runs of this route fails with an java.util.ConcurrentModificationException.

      I getting these two stack traces from to different threads:

      Thread #1: 

      org.apache.camel.RuntimeExpressionException: Unable to evaluate DataSonnet expression: 'PayerId = :?payer_id' + if (!ds.isEmpty(cml.header('orderer_id'))) then (' and OrdererId = :?orderer_id' + if (!ds.isEmpty(cml.header('workplace_id'))) then ' and Id = :?workplace_id' else '') else ''
      	at org.apache.camel.language.datasonnet.DatasonnetExpression.evaluate(DatasonnetExpression.java:115) ~[camel-datasonnet-3.11.1.jar:3.11.1]
      	at org.apache.camel.processor.SetHeaderProcessor.process(SetHeaderProcessor.java:48) ~[camel-core-processor-3.11.1.jar:3.11.1]
      	at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:463) ~[camel-core-processor-3.11.1.jar:3.11.1]
      	at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:179) ~[camel-base-engine-3.11.1.jar:3.11.1]
      	at org.apache.camel.impl.engine.DefaultReactiveExecutor.schedule(DefaultReactiveExecutor.java:59) ~[camel-base-engine-3.11.1.jar:3.11.1]
      	at org.apache.camel.processor.MulticastProcessor.lambda$schedule$1(MulticastProcessor.java:348) ~[camel-core-processor-3.11.1.jar:3.11.1]
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na]
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) ~[na:na]
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[na:na]
      	at java.base/java.lang.Thread.run(Thread.java:831) ~[na:na]
      Caused by: java.util.ConcurrentModificationException: null
      	at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1225) ~[na:na]
      	at org.apache.camel.language.datasonnet.DatasonnetLanguage.computeIfMiss(DatasonnetLanguage.java:103) ~[camel-datasonnet-3.11.1.jar:3.11.1]
      	at org.apache.camel.language.datasonnet.DatasonnetExpression.doEvaluate(DatasonnetExpression.java:143) ~[camel-datasonnet-3.11.1.jar:3.11.1]
      	at org.apache.camel.language.datasonnet.DatasonnetExpression.evaluate(DatasonnetExpression.java:106) ~[camel-datasonnet-3.11.1.jar:3.11.1]
      	... 10 common frames omitted
      

      Thread #2: 

      org.apache.camel.RuntimeExpressionException: Unable to evaluate DataSonnet expression: !ds.isEmpty(cml.header('payer_id'))
      	at org.apache.camel.language.datasonnet.DatasonnetExpression.evaluate(DatasonnetExpression.java:115) ~[camel-datasonnet-3.11.1.jar:3.11.1]
      	at org.apache.camel.language.datasonnet.DatasonnetExpression.matches(DatasonnetExpression.java:93) ~[camel-datasonnet-3.11.1.jar:3.11.1]
      	at org.apache.camel.processor.FilterProcessor.matches(FilterProcessor.java:77) ~[camel-core-processor-3.11.1.jar:3.11.1]
      	at org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.java:71) ~[camel-core-processor-3.11.1.jar:3.11.1]
      	at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:463) ~[camel-core-processor-3.11.1.jar:3.11.1]
      	at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:179) ~[camel-base-engine-3.11.1.jar:3.11.1]
      	at org.apache.camel.impl.engine.DefaultReactiveExecutor.schedule(DefaultReactiveExecutor.java:59) ~[camel-base-engine-3.11.1.jar:3.11.1]
      	at org.apache.camel.processor.MulticastProcessor.lambda$schedule$1(MulticastProcessor.java:348) ~[camel-core-processor-3.11.1.jar:3.11.1]
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na]
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) ~[na:na]
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[na:na]
      	at java.base/java.lang.Thread.run(Thread.java:831) ~[na:na]
      Caused by: java.util.ConcurrentModificationException: null
      	at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1225) ~[na:na]
      	at org.apache.camel.language.datasonnet.DatasonnetLanguage.computeIfMiss(DatasonnetLanguage.java:103) ~[camel-datasonnet-3.11.1.jar:3.11.1]
      	at org.apache.camel.language.datasonnet.DatasonnetExpression.doEvaluate(DatasonnetExpression.java:143) ~[camel-datasonnet-3.11.1.jar:3.11.1]
      	at org.apache.camel.language.datasonnet.DatasonnetExpression.evaluate(DatasonnetExpression.java:106) ~[camel-datasonnet-3.11.1.jar:3.11.1]
      	... 12 common frames omitted
      

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            henka-rl Henrik Karlsson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: