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

Getting FailedToCreateProducerException with reason java.util.ConcurrentModificationException randomly when using huge split

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.11.0
    • 3.11.1, 3.12.0
    • camel-core, camel-ftp
    • None
    • Unknown

    Description

      When splitting and then sending a huge list of strings(38 000) that create xml-documents for each line. Getting randomly this exception (so not for each line, about 5 times failed):

      org.apache.camel.FailedToCreateProducerException: Failed to create Producer for endpoint: sftp://serverHere?disconnect=true. Reason: java.util.ConcurrentModificationException
      at org.apache.camel.support.cache.DefaultProducerCache.acquireProducer(DefaultProducerCache.java:155) ~[?:?]
      at org.apache.camel.support.cache.DefaultProducerCache.doInAsyncProducer(DefaultProducerCache.java:283) ~[?:?]
      at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:190) ~[?:?]
      at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:463) ~[?:?]
      at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:179) ~[?:?]
      at org.apache.camel.impl.engine.DefaultReactiveExecutor.schedule(DefaultReactiveExecutor.java:59) ~[?:?]
      at org.apache.camel.processor.MulticastProcessor.lambda$schedule$1(MulticastProcessor.java:348) ~[?:?]
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
      at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
      at java.lang.Thread.run(Thread.java:829) [?:?]
      Caused by: java.util.ConcurrentModificationException
      at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1043) ~[?:?]
      at java.util.ArrayList$Itr.next(ArrayList.java:997) ~[?:?]
      at org.apache.camel.support.cache.ServicePool$MultiplePool.cleanupEvicts(ServicePool.java:318) ~[?:?]
      at org.apache.camel.support.cache.ServicePool$MultiplePool.acquire(ServicePool.java:333) ~[?:?]
      at org.apache.camel.support.cache.ServicePool$MultiplePool.acquire(ServicePool.java:296) ~[?:?]
      at org.apache.camel.support.cache.ServicePool.acquire(ServicePool.java:109) ~[?:?]
      at org.apache.camel.support.cache.DefaultProducerCache.acquireProducer(DefaultProducerCache.java:126) ~[?:?]
      ... 11 more

       

      two routes:

      <from uri="sftp: ..."/>

      <split parallelProcessing="true">
       <tokenize token="\r\n|\n" xml="false" trim="true"/>
       <convertBodyTo type="java.lang.String" charset="UTF-8"/>
       <to uri="bean:createXML?method=collect"/>
       <to uri="direct:sendToSftpRoute"/>
      </split>

       

      <from uri="direct:sendToSftpRoute"/>

      <to uri="sftp: ...?disconnect=true"/>

       

      This issue came after upgrading from 3.4.2 -> 3.11.0

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            tapiiron Tapio Piironen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: