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

ConcurrentModificationException when serializing MultiSCMRevisionState#revisionStates

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • Jenkins 2.73.1
      workflow-scm-step-plugin 2.6
    • Pipeline SCM Step 2.7

      Since updating to Jenkins 2.73.1 and adding another build slave, we're often seeing exceptions when one of the parallel pipeline steps finishes.

      All the other parallel running steps hang after that exception is thrown, effectively blocking all executors of our CI systems until the jobs are manually cancelled.

      https://github.com/dlang/ci/blob/71199e5f0d5ee5a12aaa0985ee89e23b9e59fa9f/pipeline.groovy

      https://ci.dlang.io/job/dlang-org/job/dmd/job/master/364/consoleFull

      java.util.ConcurrentModificationException
      	at java.util.HashMap$HashIterator.nextNode(HashMap.java:1437)
      	at java.util.HashMap$EntryIterator.next(HashMap.java:1471)
      	at java.util.HashMap$EntryIterator.next(HashMap.java:1469)
      	at com.thoughtworks.xstream.converters.collections.MapConverter.marshal(MapConverter.java:75)
      	at 
      ...
      Caused: java.lang.RuntimeException: Failed to serialize org.jenkinsci.plugins.workflow.steps.scm.MultiSCMRevisionState#revisionStates for class org.jenkinsci.plugins.workflow.steps.scm.MultiSCMRevisionState
      	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
      	at 
      ...
      Caused: java.lang.RuntimeException: Failed to serialize hudson.model.Actionable#actions for class org.jenkinsci.plugins.workflow.job.WorkflowRun
      	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
      	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
      	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
      	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
      	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
      	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
      	at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82)
      	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
      	at com.thoughtworks.xstream.XStream.marshal(XStream.java:1026)
      	at com.thoughtworks.xstream.XStream.marshal(XStream.java:1015)
      	at com.thoughtworks.xstream.XStream.toXML(XStream.java:988)
      	at hudson.XmlFile.write(XmlFile.java:171)
      	at hudson.model.Run.save(Run.java:1933)
      	at hudson.BulkChange.commit(BulkChange.java:98)
      	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1221)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:407)
      	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:35)
      	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
      	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      

      Maybe a race condition on MultiSCMRevisionState's revisionStates Map?

      Seems to be similar to JENKINS-34313, but that seemed to primarily report a different issue.

          [JENKINS-47201] ConcurrentModificationException when serializing MultiSCMRevisionState#revisionStates

          Jesse Glick added a comment -

          Not sure, would have to dig into it. Linking in the meantime.

          Jesse Glick added a comment - Not sure, would have to dig into it. Linking in the meantime.

          Jesse Glick added a comment -

          Did not mean to close this.

          Jesse Glick added a comment - Did not mean to close this.

          Devin Nusbaum added a comment -

          A fix for this was just released in Pipeline SCM Step version 2.7.

          Devin Nusbaum added a comment - A fix for this was just released in Pipeline SCM Step version 2.7.

            dawg Martin Nowak
            dawg Martin Nowak
            Votes:
            4 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: