Skip to content

Commit

Permalink
[JENKINS-15369] NPE from Jenkins.removeNode continued.
Browse files Browse the repository at this point in the history
/computer/*/doDelete should try harder to remove even a “zombie” Computer with no associated Node.
  • Loading branch information
jglick committed Oct 12, 2012
1 parent a1cef72 commit 87d9a6e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -59,6 +59,9 @@
Using the bottom-sticking "OK" button in more places
<li class=rfe>
Slave logs are put into sub-directories to avoid cluttering $JENKINS_HOME
<li class=bug>
<code>/computer/*/doDelete</code> should try harder to remove even “zombie” <code>Computer</code>s.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-15369">issue 15369</a>)
<li class=rfe>
Added "manage old data" permanently to the "manage Jenkins" page.
<li class=rfe>
Expand Down
8 changes: 5 additions & 3 deletions core/src/main/java/hudson/model/Computer.java
Expand Up @@ -1176,10 +1176,12 @@ private void replaceBy(Node newNode) throws ServletException, IOException {
public HttpResponse doDoDelete() throws IOException {
checkPermission(DELETE);
Node node = getNode();
if (node == null) {
throw new IOException("Cannot delete " + nodeName + " since it does not still exist");
if (node != null) {
Jenkins.getInstance().removeNode(node);
} else {
AbstractCIBase app = Jenkins.getInstance();
app.removeComputer(this);
}
Jenkins.getInstance().removeNode(node);
return new HttpRedirect("..");
}

Expand Down

0 comments on commit 87d9a6e

Please sign in to comment.