提交 a5755cb3 编写于 作者: K Kohsuke Kawaguchi

[FIXED JENKINS-19446]

Defer the notification to avoid deadlock.
上级 7c711ac8
......@@ -63,6 +63,9 @@ Upcoming changes</a>
<div id="rc" style="display:none;"><!--=BEGIN=-->
<h3><a name=v1.543>What's new in 1.543</a> <!--=DATE=--></h3>
<ul class=image>
<li class=bug>
Fixed a possible dead lock problem in deleting projects.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-19446">issue 19446</a>)
<li class=bug>
HTML metacharacters not escaped in log messages.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-20800">issue 20800</a>)
......
......@@ -42,6 +42,7 @@ import hudson.util.AlternativeUiTextProvider.Message;
import hudson.util.AtomicFileWriter;
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;
......@@ -510,21 +511,23 @@ public abstract class AbstractItem extends Actionable implements Item, HttpDelet
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);
}
});
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册