Skip to content
Permalink
Browse files
[FIXED JENKINS-42043] Catch and log RuntimeException in setNode
Also make sure we don't mark the Computer as used so that we kill any
executors that may be related to it somehow.
  • Loading branch information
abayer committed Apr 7, 2017
1 parent 1ca9c88 commit 23b0085f453454462542ae6e0fd67915b760ee4e
Showing with 8 additions and 2 deletions.
  1. +8 −2 core/src/main/java/hudson/model/AbstractCIBase.java
@@ -36,6 +36,7 @@

import java.util.*;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.CheckForNull;

@@ -115,7 +116,12 @@ private void updateComputer(Node n, Map<String,Computer> byNameMap, Set<Computer
Computer c;
c = byNameMap.get(n.getNodeName());
if (c!=null) {
c.setNode(n); // reuse
try {
c.setNode(n); // reuse
used.add(c);
} catch (RuntimeException e) {
LOGGER.log(Level.WARNING, "Error updating node " + n.getNodeName() + ", continuing", e);
}
} else {
// we always need Computer for the master as a fallback in case there's no other Computer.
if(n.getNumExecutors()>0 || n==Jenkins.getInstance()) {
@@ -131,8 +137,8 @@ private void updateComputer(Node n, Map<String,Computer> byNameMap, Set<Computer
}
}
}
used.add(c);
}
used.add(c);
}

/*package*/ void removeComputer(final Computer computer) {

0 comments on commit 23b0085

Please sign in to comment.