FIX Don't log monitoring errors from deleted nodes
@@ -124,6 +124,11 @@ public abstract class AbstractAsyncNodeMonitorDescriptor<T> extends AbstractNode
}
private void error(Computer c, Throwable x) {
+ // JENKINS-54496: don't log if c was removed from Jenkins after we'd started monitoring
+ final boolean cIsStillCurrent = Jenkins.get().getComputer(c.getName()) == c;
+ if (!cIsStillCurrent) {
+ return;
+ }
if (c instanceof SlaveComputer) {
Functions.printStackTrace(x, ((SlaveComputer) c).getListener().error("Failed to monitor for " + getDisplayName()));
} else {
