Skip to content
Permalink
Browse files
[FIXED JENKINS-19446]
Defer the notification to avoid deadlock.

(cherry picked from commit a5755cb)

Conflicts:
	changelog.html
  • Loading branch information
kohsuke authored and olivergondza committed Feb 28, 2014
1 parent ef6343b commit 41baac80fbf559aa3eb30c635abe0386815fd67f
Showing with 17 additions and 14 deletions.
  1. +17 −14 core/src/main/java/hudson/model/AbstractItem.java
@@ -43,6 +43,7 @@
import hudson.util.IOException2;
import hudson.util.IOUtils;
import jenkins.model.Jenkins;
import jenkins.model.Jenkins.MasterComputer;
import org.apache.tools.ant.taskdefs.Copy;
import org.apache.tools.ant.types.FileSet;
import org.kohsuke.stapler.WebMethod;
@@ -508,21 +509,23 @@ public synchronized void delete() throws IOException, InterruptedException {
checkPermission(DELETE);
performDelete();

try {
invokeOnDeleted();
} catch (AbstractMethodError e) {
// ignore
}

Jenkins.getInstance().rebuildDependencyGraphAsync();
}
// defer the notification to avoid the lock ordering problem. See JENKINS-19446.
MasterComputer.threadPoolForRemoting.submit(new java.util.concurrent.Callable<Void>() {
@Override
public Void call() throws Exception {
invokeOnDeleted();
Jenkins.getInstance().rebuildDependencyGraphAsync();
return null;
}

/**
* A pointless function to work around what appears to be a HotSpot problem. See JENKINS-5756 and bug 6933067
* on BugParade for more details.
*/
private void invokeOnDeleted() throws IOException {
getParent().onDeleted(this);
/**
* A pointless function to work around what appears to be a HotSpot problem. See JENKINS-5756 and bug 6933067
* on BugParade for more details.
*/
private void invokeOnDeleted() throws IOException {
getParent().onDeleted(AbstractItem.this);
}
});
}

/**

0 comments on commit 41baac8

Please sign in to comment.