XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The following two threads cause a dead lock:

      	at hudson.model.AbstractProject.save(AbstractProject.java:268)
      	-  blocked on hudson.maven.MavenModuleSet@57164bd1
      	at hudson.plugins.copyartifact.CopyArtifact$ListenerImpl.onRenamed(CopyArtifact.java:331)
      	at hudson.model.AbstractItem.renameTo(AbstractItem.java:296)
      	-  locked hudson.model.FreeStyleProject@29a74e2b
      	-  locked com.cloudbees.hudson.plugins.folder.Folder@29a1da29
      	at hudson.model.Job.renameTo(Job.java:577)
      	at hudson.model.Job.doDoRename(Job.java:1311)
      	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 org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:288)
      	at org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.java:29)
      	at org.kohsuke.stapler.Function$InterceptedFunction.invoke(Function.java:389)
      
      	at hudson.model.Project.getPublishersList(Project.java:114)
      	-  blocked on hudson.model.FreeStyleProject@29a74e2b
      	at hudson.model.Project.buildDependencyGraph(Project.java:172)
      	at hudson.model.DependencyGraph.build(DependencyGraph.java:90)
      	at jenkins.model.Jenkins.rebuildDependencyGraph(Jenkins.java:3563)
      	at hudson.model.AbstractItem.delete(AbstractItem.java:515)
      	-  locked hudson.maven.MavenModuleSet@57164bd1
      	at hudson.model.Job.delete(Job.java:587)
      	-  locked hudson.maven.MavenModuleSet@57164bd1
      	at com.cloudbees.hudson.plugins.folder.Folder.performDelete(Folder.java:505)
      	at hudson.model.AbstractItem.delete(AbstractItem.java:507)
      	-  locked com.cloudbees.hudson.plugins.folder.Folder@44bf68c1
      	at hudson.model.AbstractItem.doDoDelete(AbstractItem.java:484)
      

        Attachments

          Issue Links

            Activity

            kohsuke Kohsuke Kawaguchi created issue -
            Hide
            kohsuke Kohsuke Kawaguchi added a comment -

            To generally reduce the likelihood of dead locks like this, we should prefer lock-less code wherever possible. I'm changing Project.getPublishersList() to not to require a locking by using a volatile field.

            I experimented a little with using AtomicReference, which looks cleaner, but making this work transparently with XStream turns out to be very difficult, especially when the element in XML may not be present.

            The other obvious approach is to the instantiation code in onLoad, but this method is getting complex enough that we need to worry about fixing up fields in the correct order, and IIRC the reason we moved the initializer into the getter method in the first place was because we had such an ordering issue.

            Show
            kohsuke Kohsuke Kawaguchi added a comment - To generally reduce the likelihood of dead locks like this, we should prefer lock-less code wherever possible. I'm changing Project.getPublishersList() to not to require a locking by using a volatile field. I experimented a little with using AtomicReference , which looks cleaner, but making this work transparently with XStream turns out to be very difficult, especially when the element in XML may not be present. The other obvious approach is to the instantiation code in onLoad , but this method is getting complex enough that we need to worry about fixing up fields in the correct order, and IIRC the reason we moved the initializer into the getter method in the first place was because we had such an ordering issue.
            kohsuke Kohsuke Kawaguchi made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-15817 [ JENKINS-15817 ]
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Kohsuke Kawaguchi
            Path:
            changelog.html
            core/src/main/java/hudson/matrix/MatrixProject.java
            core/src/main/java/hudson/model/AbstractProject.java
            core/src/main/java/hudson/model/Project.java
            maven-plugin/src/main/java/hudson/maven/AbstractMavenProject.java
            test/src/test/groovy/hudson/model/AbstractProjectTest.groovy
            test/src/test/resources/hudson/model/AbstractProjectTest/vectorTriggers.xml
            http://jenkins-ci.org/commit/jenkins/7facc7733c7040536d4074a2c5805b75ee1d8f35
            Log:
            [FIXED JENKINS-18589]

            Use DescribableList to handle the copy-on-write semantics correctly. The vector class just doesn't cut it, and we've been setting a new value to this field, which will violates all sorts of the concurrent programming practice.

            This change has the nice side effect of removing class="vector" from the persisted XML. A test is added to make sure we can still read back such an XML.

            Compare: https://github.com/jenkinsci/jenkins/compare/6ceafac2cd6b...7facc7733c70

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html core/src/main/java/hudson/matrix/MatrixProject.java core/src/main/java/hudson/model/AbstractProject.java core/src/main/java/hudson/model/Project.java maven-plugin/src/main/java/hudson/maven/AbstractMavenProject.java test/src/test/groovy/hudson/model/AbstractProjectTest.groovy test/src/test/resources/hudson/model/AbstractProjectTest/vectorTriggers.xml http://jenkins-ci.org/commit/jenkins/7facc7733c7040536d4074a2c5805b75ee1d8f35 Log: [FIXED JENKINS-18589] Use DescribableList to handle the copy-on-write semantics correctly. The vector class just doesn't cut it, and we've been setting a new value to this field, which will violates all sorts of the concurrent programming practice. This change has the nice side effect of removing class="vector" from the persisted XML. A test is added to make sure we can still read back such an XML. Compare: https://github.com/jenkinsci/jenkins/compare/6ceafac2cd6b...7facc7733c70
            scm_issue_link SCM/JIRA link daemon made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            teilo James Nord made changes -
            Labels lts-candidate
            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #2687

            Result = UNSTABLE

            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #2687 Result = UNSTABLE
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stefan Hirche
            Path:
            src/main/java/hudson/ivy/AbstractIvyProject.java
            http://jenkins-ci.org/commit/ivy-plugin/802921415942bc9c90e81d07ce05910c856bfaae
            Log:
            Triggers is not a field anymore, it's a method now, following fix for issue JENKINS-18589

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stefan Hirche Path: src/main/java/hudson/ivy/AbstractIvyProject.java http://jenkins-ci.org/commit/ivy-plugin/802921415942bc9c90e81d07ce05910c856bfaae Log: Triggers is not a field anymore, it's a method now, following fix for issue JENKINS-18589
            Hide
            johno Johno Crawford added a comment -

            @kohsuke any ideas on how to maintain backward compatibility for ivy-plugin? or should we bump required core to 1.5xx?

            for (Trigger<?> trigger : getTriggers().values()) might be an option albeit ugly..

            Show
            johno Johno Crawford added a comment - @kohsuke any ideas on how to maintain backward compatibility for ivy-plugin? or should we bump required core to 1.5xx? for (Trigger<?> trigger : getTriggers().values()) might be an option albeit ugly..
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Johno Crawford
            Path:
            src/main/java/hudson/ivy/AbstractIvyProject.java
            http://jenkins-ci.org/commit/ivy-plugin/9c967e3833e4542e16920756a239ab09009923fe
            Log:
            Triggers is not a field anymore, it's a method now, following fix for issue JENKINS-18589

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Johno Crawford Path: src/main/java/hudson/ivy/AbstractIvyProject.java http://jenkins-ci.org/commit/ivy-plugin/9c967e3833e4542e16920756a239ab09009923fe Log: Triggers is not a field anymore, it's a method now, following fix for issue JENKINS-18589
            Hide
            dmatag dmatag added a comment -

            This solution (https://github.com/jenkinsci/jenkins/commit/7facc7733c7040536d4074a2c5805b75ee1d8f35) causes UnsupportedOperationException from AbstractProject.removeTrigger and addTrigger. DescribableList is AbstractList and we cannot modify them. Do you have any workaround to solve it?

            Show
            dmatag dmatag added a comment - This solution ( https://github.com/jenkinsci/jenkins/commit/7facc7733c7040536d4074a2c5805b75ee1d8f35 ) causes UnsupportedOperationException from AbstractProject.removeTrigger and addTrigger. DescribableList is AbstractList and we cannot modify them. Do you have any workaround to solve it?
            jglick Jesse Glick made changes -
            Link This issue is blocking JENKINS-18677 [ JENKINS-18677 ]
            Hide
            jglick Jesse Glick added a comment -

            Cannot be backported without also including fix for JENKINS-18677.

            Show
            jglick Jesse Glick added a comment - Cannot be backported without also including fix for JENKINS-18677 .
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Kohsuke Kawaguchi
            Path:
            changelog.html
            core/src/main/java/hudson/matrix/MatrixProject.java
            core/src/main/java/hudson/model/AbstractProject.java
            core/src/main/java/hudson/model/Project.java
            maven-plugin/src/main/java/hudson/maven/AbstractMavenProject.java
            test/src/test/groovy/hudson/model/AbstractProjectTest.groovy
            test/src/test/resources/hudson/model/AbstractProjectTest/vectorTriggers.xml
            http://jenkins-ci.org/commit/jenkins/5407d9fbce6b10d6902f0cc5971ee95c71619f3a
            Log:
            [FIXED JENKINS-18589]

            Use DescribableList to handle the copy-on-write semantics correctly. The vector class just doesn't cut it, and we've been setting a new value to this field, which will violates all sorts of the concurrent programming practice.

            This change has the nice side effect of removing class="vector" from the persisted XML. A test is added to make sure we can still read back such an XML.

            (cherry picked from commit 7facc7733c7040536d4074a2c5805b75ee1d8f35)

            Conflicts:
            test/src/test/groovy/hudson/model/AbstractProjectTest.groovy

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html core/src/main/java/hudson/matrix/MatrixProject.java core/src/main/java/hudson/model/AbstractProject.java core/src/main/java/hudson/model/Project.java maven-plugin/src/main/java/hudson/maven/AbstractMavenProject.java test/src/test/groovy/hudson/model/AbstractProjectTest.groovy test/src/test/resources/hudson/model/AbstractProjectTest/vectorTriggers.xml http://jenkins-ci.org/commit/jenkins/5407d9fbce6b10d6902f0cc5971ee95c71619f3a Log: [FIXED JENKINS-18589] Use DescribableList to handle the copy-on-write semantics correctly. The vector class just doesn't cut it, and we've been setting a new value to this field, which will violates all sorts of the concurrent programming practice. This change has the nice side effect of removing class="vector" from the persisted XML. A test is added to make sure we can still read back such an XML. (cherry picked from commit 7facc7733c7040536d4074a2c5805b75ee1d8f35) Conflicts: test/src/test/groovy/hudson/model/AbstractProjectTest.groovy
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Kohsuke Kawaguchi
            Path:
            test/src/test/java/hudson/triggers/TriggerStartTest.java
            http://jenkins-ci.org/commit/jenkins/f9e176a5baa5baa85d0e9bb8f8bd23bc47272fd2
            Log:
            JENKINS-18589 Updatign tests

            (cherry picked from commit 87851d176503123ba35ffe22c5a56322d9c2b352)

            Compare: https://github.com/jenkinsci/jenkins/compare/a021fe5c2422...f9e176a5baa5

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: test/src/test/java/hudson/triggers/TriggerStartTest.java http://jenkins-ci.org/commit/jenkins/f9e176a5baa5baa85d0e9bb8f8bd23bc47272fd2 Log: JENKINS-18589 Updatign tests (cherry picked from commit 87851d176503123ba35ffe22c5a56322d9c2b352) Compare: https://github.com/jenkinsci/jenkins/compare/a021fe5c2422...f9e176a5baa5
            olivergondza Oliver Gond┼ża made changes -
            Labels lts-candidate 1.509.4-fixed
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Kohsuke Kawaguchi
            Path:
            src/main/java/hudson/maven/AbstractMavenProject.java
            http://jenkins-ci.org/commit/maven-plugin/a779e6769320d88abc905a454f2fe7f45f5ed5f0
            Log:
            [FIXED JENKINS-18589]

            Use DescribableList to handle the copy-on-write semantics correctly. The vector class just doesn't cut it, and we've been setting a new value to this field, which will violates all sorts of the concurrent programming practice.

            This change has the nice side effect of removing class="vector" from the persisted XML. A test is added to make sure we can still read back such an XML.

            Originally-Committed-As: 7facc7733c7040536d4074a2c5805b75ee1d8f35

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: src/main/java/hudson/maven/AbstractMavenProject.java http://jenkins-ci.org/commit/maven-plugin/a779e6769320d88abc905a454f2fe7f45f5ed5f0 Log: [FIXED JENKINS-18589] Use DescribableList to handle the copy-on-write semantics correctly. The vector class just doesn't cut it, and we've been setting a new value to this field, which will violates all sorts of the concurrent programming practice. This change has the nice side effect of removing class="vector" from the persisted XML. A test is added to make sure we can still read back such an XML. Originally-Committed-As: 7facc7733c7040536d4074a2c5805b75ee1d8f35
            oleg_nenashev Oleg Nenashev made changes -
            Link This issue is duplicated by JENKINS-18169 [ JENKINS-18169 ]
            oleg_nenashev Oleg Nenashev made changes -
            Link This issue is duplicated by JENKINS-18347 [ JENKINS-18347 ]
            jglick Jesse Glick made changes -
            Link This issue is blocking JENKINS-18677 [ JENKINS-18677 ]
            jglick Jesse Glick made changes -
            Link This issue depends on JENKINS-18677 [ JENKINS-18677 ]
            jberkenbilt Jay Berkenbilt made changes -
            Link This issue is duplicated by JENKINS-17999 [ JENKINS-17999 ]
            jglick Jesse Glick made changes -
            Link This issue is duplicated by JENKINS-17820 [ JENKINS-17820 ]
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-25940 [ JENKINS-25940 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 149899 ] JNJira + In-Review [ 193339 ]

              People

              • Assignee:
                kohsuke Kohsuke Kawaguchi
                Reporter:
                kohsuke Kohsuke Kawaguchi
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: