mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 05:22:22 +00:00
[FIXED JENKINS-4220] fixed a dead lock.
While the original report is in https://cloudbees.zendesk.com/tickets/427, this fix also takes care of JENKINS-4220.
This commit is contained in:
1 parent
584112aa27
commit
53a31c3153
2 files changed
+15
-2
No files matched your search
@@ -126,6 +126,8 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
|
||||
|
||||
private String mavenVersionUsed;
|
||||
|
||||
private transient Object notifyModuleBuildLock = new Object();
|
||||
|
||||
public MavenModuleSetBuild(MavenModuleSet job) throws IOException {
|
||||
super(job);
|
||||
}
|
||||
@@ -134,6 +136,12 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
|
||||
super(project, buildDir);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onLoad() {
|
||||
super.onLoad();
|
||||
notifyModuleBuildLock = new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* Exposes {@code MAVEN_OPTS} to forked processes.
|
||||
*
|
||||
@@ -457,7 +465,9 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
|
||||
|
||||
// actions need to be replaced atomically especially
|
||||
// given that two builds might complete simultaneously.
|
||||
synchronized(this) {
|
||||
// use a separate lock object since this synchronized block calls into plugins,
|
||||
// which in turn can access other MavenModuleSetBuild instances, which will result in a dead lock.
|
||||
synchronized(notifyModuleBuildLock) {
|
||||
boolean modified = false;
|
||||
|
||||
List<Action> actions = getActions();
|
||||
@@ -1318,7 +1328,7 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
|
||||
* Extra verbose debug switch.
|
||||
*/
|
||||
public static boolean debug = Boolean.getBoolean( "hudson.maven.debug" );
|
||||
|
||||
|
||||
@Override
|
||||
public MavenModuleSet getParent() {// don't know why, but javac wants this
|
||||
return super.getParent();
|
||||
|
||||
Reference in new issue
Block a user