-
Bug
-
Resolution: Fixed
-
Major
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)
- depends on
-
JENKINS-18677 Some jobs not loaded after jenkins restart: java.lang.NoSuchFieldError: triggers
-
- Resolved
-
- is duplicated by
-
JENKINS-18169 Deadlock when running multiple delete
-
- Resolved
-
-
JENKINS-17820 Deadlock between a folder copy and job deletion
-
- Resolved
-
-
JENKINS-18347 Deadlock when renaming 2 jobs at the same time
-
- Closed
-
-
JENKINS-17999 deadlock in 1.509.1 deleting multiple jobs with REST API
-
- Closed
-
- is related to
-
JENKINS-15817 XStream form of projects excessively strict about null fields
-
- Resolved
-
-
JENKINS-25940 NPE from EmailExtTemplateActionFactory.createFor due to MavenModuleSet.getPublishersList being null
-
- Open
-
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.