Skip to content
Permalink
Browse files

[JENKINS-35190] Turning off redundant PingThread from Launcher.

Also using new onDead overload.
  • Loading branch information
jglick committed May 27, 2016
1 parent 1fc3c93 commit 7ff0a9ae79eb897bb70d9a88296985f5b67b3c81
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/main/java/hudson/remoting/Launcher.java
@@ -76,6 +76,8 @@
import java.security.KeyManagementException;
import java.security.SecureRandom;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;

@@ -521,14 +523,22 @@ public static void main(InputStream is, OutputStream os, Mode mode, boolean perf
long timeout = 1000 * Long.parseLong(
System.getProperty("hudson.remoting.Launcher.pingTimeoutSec", "240")),
interval = 1000 * Long.parseLong(
System.getProperty("hudson.remoting.Launcher.pingIntervalSec", "600"));
System.getProperty("hudson.remoting.Launcher.pingIntervalSec", /* was "600" but this duplicates ChannelPinger */ "0"));
Logger.getLogger(PingThread.class.getName()).log(Level.FINE, "performPing={0} timeout={1} interval={2}", new Object[] {performPing, timeout, interval});
if (performPing && timeout > 0 && interval > 0) {
new PingThread(channel, timeout, interval) {
@Deprecated
@Override
protected void onDead() {
System.err.println("Ping failed. Terminating");
System.exit(-1);
}
@Override
protected void onDead(Throwable cause) {
System.err.println("Ping failed. Terminating");
cause.printStackTrace();
System.exit(-1);
}
}.start();
}
channel.join();

0 comments on commit 7ff0a9a

Please sign in to comment.
You can’t perform that action at this time.