Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
JENKINS-27183 Avoid deadlock when using build-monitor-plugin
(cherry picked from commit fb5540e)
  • Loading branch information
fbelzunc authored and olivergondza committed Mar 31, 2015
1 parent 0488078 commit bc57131
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions core/src/main/java/hudson/model/AbstractItem.java
Expand Up @@ -215,6 +215,8 @@ protected void doSetName(String name) {
protected void renameTo(final String newName) throws IOException {
// always synchronize from bigger objects first
final ItemGroup parent = getParent();
String oldName = this.name;
String oldFullName = getFullName();
synchronized (parent) {
synchronized (this) {
// sanity check
Expand Down Expand Up @@ -247,9 +249,6 @@ public Void call() throws IOException {
}
});


String oldName = this.name;
String oldFullName = getFullName();
File oldRoot = this.getRootDir();

doSetName(newName);
Expand Down Expand Up @@ -323,10 +322,9 @@ public Void call() throws IOException {
} catch (AbstractMethodError _) {
// ignore
}

ItemListener.fireLocationChange(this, oldFullName);
}
}
ItemListener.fireLocationChange(this, oldFullName);
}

public void movedTo(DirectlyModifiableTopLevelItemGroup destination, AbstractItem newItem, File destDir) throws IOException {
Expand Down

0 comments on commit bc57131

Please sign in to comment.