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

[XStream] ConcurrentModificationException from DefaultConverterLookup

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      A user reported a hung Jenkins instance displaying an error:

      org.jvnet.hudson.reactor.ReactorException: java.lang.Error: java.lang.reflect.InvocationTargetException 
      	at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:246) 
      	at jenkins.InitReactorRunner.run(InitReactorRunner.java:43) 
      	at jenkins.model.Jenkins.executeReactor(Jenkins.java:904) 
      	at jenkins.model.Jenkins.<init>(Jenkins.java:804) 
      	at hudson.model.Hudson.<init>(Hudson.java:81) 
      	at hudson.model.Hudson.<init>(Hudson.java:77) 
      	at hudson.WebAppMain$2.run(WebAppMain.java:214) 
      Caused by: java.lang.Error: java.lang.reflect.InvocationTargetException 
      	at hudson.init.InitializerFinder.invoke(InitializerFinder.java:124) 
      	at hudson.init.InitializerFinder$TaskImpl.run(InitializerFinder.java:184) 
      	at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259) 
      	at jenkins.model.Jenkins$7.runTask(Jenkins.java:893) 
      	at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187) 
      	at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94) 
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) 
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) 
      	at java.lang.Thread.run(Thread.java:722) 
      Caused by: java.lang.reflect.InvocationTargetException 
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
      	at java.lang.reflect.Method.invoke(Method.java:601) 
      	at hudson.init.InitializerFinder.invoke(InitializerFinder.java:120) 
      ... 8 more 
      Caused by: java.util.ConcurrentModificationException 
      	at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1115) 
      	at java.util.TreeMap$KeyIterator.next(TreeMap.java:1169) 
      	at com.thoughtworks.xstream.core.util.PrioritizedList$PrioritizedItemIterator.next(PrioritizedList.java:91) 
      	at com.thoughtworks.xstream.core.DefaultConverterLookup.lookupConverterForType(DefaultConverterLookup.java:55) 
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:56)
      

      Seems that DefaultConverterLookup is failing to synchronize access to its converters field; probably another thread was calling registerConverter in the middle of this loop.

        Attachments

          Issue Links

            Activity

            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #2834
            JENKINS-18775 JENKINS-17248 Noting. (Revision d3fa3bc906c7cb88c267f36b8eba1150435f9aaf)

            Result = UNSTABLE
            Jesse Glick : d3fa3bc906c7cb88c267f36b8eba1150435f9aaf
            Files :

            • changelog.html
            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #2834 JENKINS-18775 JENKINS-17248 Noting. (Revision d3fa3bc906c7cb88c267f36b8eba1150435f9aaf) Result = UNSTABLE Jesse Glick : d3fa3bc906c7cb88c267f36b8eba1150435f9aaf Files : changelog.html
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            core/src/main/java/hudson/util/XStream2.java
            http://jenkins-ci.org/commit/jenkins/1d20c524e14353aa2c047586a300180d1cdf15d2
            Log:
            JENKINS-18775 Noting that this usage of XStream is unsupported and could cause future problems.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/util/XStream2.java http://jenkins-ci.org/commit/jenkins/1d20c524e14353aa2c047586a300180d1cdf15d2 Log: JENKINS-18775 Noting that this usage of XStream is unsupported and could cause future problems.
            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #2839
            JENKINS-18775 Noting that this usage of XStream is unsupported and could cause future problems. (Revision 1d20c524e14353aa2c047586a300180d1cdf15d2)

            Result = SUCCESS
            Jesse Glick : 1d20c524e14353aa2c047586a300180d1cdf15d2
            Files :

            • core/src/main/java/hudson/util/XStream2.java
            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #2839 JENKINS-18775 Noting that this usage of XStream is unsupported and could cause future problems. (Revision 1d20c524e14353aa2c047586a300180d1cdf15d2) Result = SUCCESS Jesse Glick : 1d20c524e14353aa2c047586a300180d1cdf15d2 Files : core/src/main/java/hudson/util/XStream2.java
            Hide
            t_kurki Teppo Kurki added a comment -

            Are you quite sure about the fix in http://jenkins-ci.org/commit/xstream/f3cd8709b1bb640109ddd60daebe7d69bdb719e1 ?

            Just putting synchronized on all the methods fixes the problem, but is a potentially big bottleneck and not necessary, see https://issues.jenkins-ci.org/browse/JENKINS-19561?focusedCommentId=185282&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-185282

            Show
            t_kurki Teppo Kurki added a comment - Are you quite sure about the fix in http://jenkins-ci.org/commit/xstream/f3cd8709b1bb640109ddd60daebe7d69bdb719e1 ? Just putting synchronized on all the methods fixes the problem, but is a potentially big bottleneck and not necessary, see https://issues.jenkins-ci.org/browse/JENKINS-19561?focusedCommentId=185282&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-185282
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            core/pom.xml
            http://jenkins-ci.org/commit/jenkins/20004f839d3b59920fd8cd608ff33ea691fe1326
            Log:
            [FIXED JENKINS-18775] Integrated XStream 1.4.4-jenkins-4 with attempted fix for race condition.

            (cherry picked from commit 89c94dda875fba273d22451c540c2ad9e4ac0197)

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/pom.xml http://jenkins-ci.org/commit/jenkins/20004f839d3b59920fd8cd608ff33ea691fe1326 Log: [FIXED JENKINS-18775] Integrated XStream 1.4.4-jenkins-4 with attempted fix for race condition. (cherry picked from commit 89c94dda875fba273d22451c540c2ad9e4ac0197)

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                jglick Jesse Glick
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: