Skip to content

Commit 53211e0

Browse files
committed
8318961: increase javacserver connection timeout values and max retry attempts
Reviewed-by: mbaesken Backport-of: b9983c72295a31e5f5079bc96c892177fbea3a6e
1 parent 5d86e19 commit 53211e0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/jdk.compiler/share/classes/com/sun/tools/sjavac/client/SjavacClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ public class SjavacClient implements Sjavac {
6969
// Accept 120 seconds of inactivity before quitting.
7070
private static final int KEEPALIVE = 120;
7171
private static final int POOLSIZE = Runtime.getRuntime().availableProcessors();
72-
// Wait 2 seconds for response, before giving up on javac server.
73-
private static final int CONNECTION_TIMEOUT = 2000;
74-
private static final int MAX_CONNECT_ATTEMPTS = 3;
72+
// Wait 4 seconds for response, before giving up on javac server.
73+
private static final int CONNECTION_TIMEOUT = 4000;
74+
private static final int MAX_CONNECT_ATTEMPTS = 10;
7575
private static final int WAIT_BETWEEN_CONNECT_ATTEMPTS = 2000;
7676

7777
public SjavacClient(Options options) {
@@ -184,7 +184,7 @@ private Socket tryConnect() throws IOException, InterruptedException {
184184
Log.error("Connection attempt failed: " + ex.getMessage());
185185
if (attempt >= MAX_CONNECT_ATTEMPTS) {
186186
Log.error("Giving up");
187-
throw new IOException("Could not connect to server", ex);
187+
throw new IOException("Could not connect to server after " + MAX_CONNECT_ATTEMPTS + " attempts with timeout " + CONNECTION_TIMEOUT, ex);
188188
}
189189
}
190190
Thread.sleep(WAIT_BETWEEN_CONNECT_ATTEMPTS);

0 commit comments

Comments
 (0)