Skip to content

Commit

Permalink
[JENKINS-47425] Do not print a stack trace on connection error (#202)
Browse files Browse the repository at this point in the history
* 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 a450c9e
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit a450c9e

Please sign in to comment.