From 5f1bde322707dcd96d18ea8c28da6e6705c7d77b Mon Sep 17 00:00:00 2001 From: Brady Alleman Date: Mon, 30 Nov 2020 13:57:52 -0500 Subject: [PATCH] Fixes [JENKINS-64335] * Do not set slaveIsDisconnecting for temporarily offline nodes --- .../java/org/jenkinsci/plugins/vSphereCloudLauncher.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jenkinsci/plugins/vSphereCloudLauncher.java b/src/main/java/org/jenkinsci/plugins/vSphereCloudLauncher.java index 7cf8f1c..4fd8ece 100644 --- a/src/main/java/org/jenkinsci/plugins/vSphereCloudLauncher.java +++ b/src/main/java/org/jenkinsci/plugins/vSphereCloudLauncher.java @@ -291,7 +291,6 @@ public synchronized void afterDisconnect(SlaveComputer slaveComputer, TaskListen vSphereCloud.Log(slaveComputer, taskListener, "Already disconnecting on a separate thread"); return; } - vsSlave.slaveIsDisconnecting = Boolean.TRUE; } else { vSphereCloud.Log(slaveComputer, taskListener, "Slave is null. Will still attempt to tear down launcher."); } @@ -303,6 +302,11 @@ public synchronized void afterDisconnect(SlaveComputer slaveComputer, TaskListen } } + if (vsSlave != null) { + // This must be done after the isTemporarilyOffline() check, since the full disconnect may not occur + vsSlave.slaveIsDisconnecting = Boolean.TRUE; + } + VSphere v = null; boolean reconnect = false; try {