File tree Expand file tree Collapse file tree
src/main/java/hudson/remoting Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1159,30 +1159,16 @@ private void onConnectionRejected(String greeting) throws InterruptedException {
11591159 }
11601160
11611161 /**
1162- * Connects to TCP agent host:port, with a few retries .
1162+ * Connects to TCP agent host:port.
11631163 * @param endpoint Connection endpoint
11641164 * @throws IOException Connection failure or invalid parameter specification
11651165 */
11661166 private Socket connectTcp (@ NonNull JnlpAgentEndpoint endpoint ) throws IOException , InterruptedException {
1167-
11681167 String msg = "Connecting to " + endpoint .getHost () + ':' + endpoint .getPort ();
11691168 events .status (msg );
1170- int retry = 1 ;
1171- while (true ) {
1172- try {
1173- final Socket s =
1174- endpoint .open (SOCKET_TIMEOUT ); // default is 30 mins. See PingThread for the ping interval
1175- s .setKeepAlive (keepAlive );
1176- return s ;
1177- } catch (IOException e ) {
1178- if (retry ++ > 10 ) {
1179- throw e ;
1180- }
1181- // TODO refactor various sleep statements into a common method
1182- TimeUnit .SECONDS .sleep (10 );
1183- events .status (msg + " (retrying:" + retry + ")" , e );
1184- }
1185- }
1169+ Socket s = endpoint .open (SOCKET_TIMEOUT ); // default is 30 mins. See PingThread for the ping interval
1170+ s .setKeepAlive (keepAlive );
1171+ return s ;
11861172 }
11871173
11881174 /**
You can’t perform that action at this time.
0 commit comments