Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-69064

ConcurrentModificationException in ExecuteDslScripts

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • job-dsl-plugin
    • None
    • Jenkins 2.346.1, Java 8/11

      As part of the cleanup of removed templates in the updateTemplates() method, all seed job references are read for the removed template. These references are then filtered to those matching the seed job name. These matches are then removed from the seed job references.

      However, the filtered references are a 'live' view (from Collections2.filter) of the original seed job references, so attempting to remove them results in a ConcurrentModificationException.

       

      We've seen this intermittently when using a pipeline to create jobs using jobDsl scripts containing templates.

       

      Full stack trace:

      Jenkins_Job_TEMPLATE java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextNode(HashMap.java:1445) at java.util.HashMap$KeyIterator.next(HashMap.java:1469) at com.google.common.collect.AbstractMultimap$WrappedCollection$WrappedIterator.next(AbstractMultimap.java:531) at com.google.common.collect.Iterators$7.computeNext(Iterators.java:648) at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143) at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138) at java.util.AbstractSet.removeAll(AbstractSet.java:173) at com.google.common.collect.AbstractMultimap$WrappedCollection.removeAll(AbstractMultimap.java:617) at javaposse.jobdsl.plugin.ExecuteDslScripts.updateTemplates(ExecuteDslScripts.java:412) at javaposse.jobdsl.plugin.ExecuteDslScripts.perform(ExecuteDslScripts.java:363) at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123) at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:100)

       

       

      PR to fix issue submitted as https://github.com/jenkinsci/job-dsl-plugin/pull/1253

       

            jamietanna Jamie Tanna
            gilestaylor g t
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: