Skip to content

Commit b9983c7

Browse files
committed
8318961: increase javacserver connection timeout values and max retry attempts
Reviewed-by: clanger, erikj
1 parent a581897 commit b9983c7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

make/langtools/tools/javacserver/client/Client.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
public class Client {
5252
private static final Log.Level LOG_LEVEL = Log.Level.INFO;
5353

54-
// Wait 2 seconds for response, before giving up on javac server.
55-
private static final int CONNECTION_TIMEOUT = 2000;
56-
private static final int MAX_CONNECT_ATTEMPTS = 3;
54+
// Wait 4 seconds for response, before giving up on javac server.
55+
private static final int CONNECTION_TIMEOUT = 4000;
56+
private static final int MAX_CONNECT_ATTEMPTS = 10;
5757
private static final int WAIT_BETWEEN_CONNECT_ATTEMPTS = 2000;
5858

5959
private final ClientConfiguration conf;
@@ -130,7 +130,7 @@ private Socket tryConnect() throws IOException, InterruptedException {
130130
Log.error("Connection attempt failed: " + ex.getMessage());
131131
if (attempt >= MAX_CONNECT_ATTEMPTS) {
132132
Log.error("Giving up");
133-
throw new IOException("Could not connect to server", ex);
133+
throw new IOException("Could not connect to server after " + MAX_CONNECT_ATTEMPTS + " attempts with timeout " + CONNECTION_TIMEOUT, ex);
134134
}
135135
}
136136
Thread.sleep(WAIT_BETWEEN_CONNECT_ATTEMPTS);

0 commit comments

Comments
 (0)