Skip to content

Commit

Permalink
Increase the timeout to connect the debugger to Liberty to 6 minutes
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Gooderham <[email protected]>
  • Loading branch information
turkeylurkey committed Oct 29, 2024
1 parent cea13c5 commit 7c27b92
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,16 @@ private void createAndRunDebugConfiguration(ProgressIndicator indicator, Liberty
*/
private String waitForSocketActivation(ProgressIndicator monitor, LibertyModule libertyModule, String host, int debugPort) throws Exception {
byte[] handshakeString = "JDWP-Handshake".getBytes(StandardCharsets.US_ASCII);
int retryLimit = 60; // wait up to 3 minutes for dev mode to start (polling rate 20 per minute, 3s)
int retryLimit = 3600; // seconds to wait for Liberty dev mode to start. It can take 4-5 minutes during testing.
int retryInc = 3; // time to wait after each try

// Retrieve the location of the server.env in the liberty installation at the default location (wpl/usr/servers/<serverName>).
Path serverEnvPath = getServerEnvPath(libertyModule);
// If the server.env has not been created yet then someone did a 'clean' before starting
boolean cleanStart = serverEnvPath == null;
Path serverEnvBakPath = null;

for (int retryCount = 0; retryCount < retryLimit; retryCount++) {
for (int retryCount = 0; retryCount < retryLimit; retryCount+=retryInc) {
// check if cancelled
if (monitor.isCanceled()) {
return null;
Expand Down Expand Up @@ -210,7 +211,7 @@ private String waitForSocketActivation(ProgressIndicator monitor, LibertyModule
LOGGER.trace(String.format("ConnectException waiting for runtime to start on port %d", debugPort));
}
}
TimeUnit.SECONDS.sleep(3);
TimeUnit.SECONDS.sleep(retryInc);
}
throw new Exception(LocalizedResourceUtil.getMessage("cannot.attach.debugger.host.port", host, String.format("%d",debugPort)));
}
Expand Down

0 comments on commit 7c27b92

Please sign in to comment.