Skip to content
Permalink
Browse files

[JENKINS-47425] Do not print a stack trace on connection error (#202)

* Do not print a stack trace on connection error

It is a possible condition and just pollutes the logs

* [JENKINS-47425] Do not print a stack trace on remoting connection error

It is a possible condition and just pollutes the logs

* retry again -> try again
  • Loading branch information
carlossg authored and oleg-nenashev committed Oct 16, 2017
1 parent 0a4dfb7 commit a450c9e4d9dbd235cdd91af04f53a500a3a55788
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/main/java/org/jenkinsci/remoting/engine/JnlpAgentEndpointResolver.java
@@ -25,12 +25,15 @@

import hudson.remoting.Base64;
import java.io.IOException;
import java.net.ConnectException;
import java.net.HttpURLConnection;
import java.net.InetSocketAddress;
import java.net.MalformedURLException;
import java.net.NoRouteToHostException;
import java.net.Proxy;
import java.net.ProxySelector;
import java.net.SocketAddress;
import java.net.SocketTimeoutException;
import java.net.URI;
import java.net.URL;
import java.net.URLConnection;
@@ -315,11 +318,14 @@ public void waitForReady() throws InterruptedException {
return;
}
LOGGER.log(Level.INFO,
"Master isn''t ready to talk to us on {0}. Will retry again: response code={1}",
"Master isn''t ready to talk to us on {0}. Will try again: response code={1}",
new Object[]{url, con.getResponseCode()});
} catch (SocketTimeoutException | ConnectException | NoRouteToHostException e) {
LOGGER.log(INFO, "Failed to connect to the master. Will try again: {0} {1}",
new String[] { e.getClass().getName(), e.getMessage() });
} catch (IOException e) {
// report the failure
LOGGER.log(INFO, "Failed to connect to the master. Will retry again", e);
LOGGER.log(INFO, "Failed to connect to the master. Will try again", e);
}
}
} finally {

0 comments on commit a450c9e

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