Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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 7ff0a9a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main/java/hudson/remoting/Launcher.java
Expand Up @@ -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;

Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 7ff0a9a

Please sign in to comment.