From 26f1f8f7f7e55f847070dc834da70b0228a4862f Mon Sep 17 00:00:00 2001 From: Javier Lores Date: Thu, 12 Feb 2026 15:46:14 -0500 Subject: [PATCH 1/2] add retry for plugin install --- .../server/ManagedConcourseServer.java | 42 +++++++++++++++---- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java b/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java index b0a52092f..6abaf6088 100644 --- a/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java +++ b/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java @@ -690,22 +690,50 @@ public boolean hasWritesToTransport(String environment) { /** * Install the plugin(s) contained in the {@code bundle} on this * {@link ManagedConcourseServer}. - * + * * @param bundle the path to the plugin bundle * @return {@code true} if the plugin(s) from the bundle is/are installed */ public boolean installPlugin(Path bundle) { log.info("Attempting to install plugins from {}", bundle); - List out = executeCli("plugin", "install", bundle.toString(), - "--username admin", "--password admin"); - for (String line : out) { - if(line.contains("Successfully installed")) { - return true; + int maxAttempts = 10; + long waitMs = 500; + List out = null; + + for (int attempt = 1; attempt <= maxAttempts; attempt++) { + out = executeCli("plugin", "install", bundle.toString(), + "--username admin", "--password admin"); + + boolean managementServerNotReady = false; + for (String line : out) { + if (line.contains("Successfully installed")) { + return true; + } + if (line.contains("Could not connect to the management server")) { + managementServerNotReady = true; + } + } + + if (managementServerNotReady && attempt < maxAttempts) { + log.debug("Management server not ready, waiting {}ms before retry (attempt {}/{})", + waitMs, attempt, maxAttempts); + try { + Thread.sleep(waitMs); + waitMs = Math.min(waitMs * 2, 5000); // exponential backoff, max 5 seconds + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + break; + } + continue; } + + // Not a management server issue, break and throw + break; } + throw new RuntimeException(AnyStrings .format("Unable to install plugin '{}': {}", bundle, out)); - } /** From 4d70223769ae3cf729ad1fbcf3d7c29dabfa62be Mon Sep 17 00:00:00 2001 From: Javier Lores Date: Thu, 12 Feb 2026 15:55:44 -0500 Subject: [PATCH 2/2] fixed formatting --- .../automation/server/ManagedConcourseServer.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java b/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java index 6abaf6088..9e652db31 100644 --- a/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java +++ b/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java @@ -706,20 +706,23 @@ public boolean installPlugin(Path bundle) { boolean managementServerNotReady = false; for (String line : out) { - if (line.contains("Successfully installed")) { + if(line.contains("Successfully installed")) { return true; } - if (line.contains("Could not connect to the management server")) { + if(line.contains( + "Could not connect to the management server")) { managementServerNotReady = true; } } - if (managementServerNotReady && attempt < maxAttempts) { - log.debug("Management server not ready, waiting {}ms before retry (attempt {}/{})", + if(managementServerNotReady && attempt < maxAttempts) { + log.debug( + "Management server not ready, waiting {}ms before retry (attempt {}/{})", waitMs, attempt, maxAttempts); try { Thread.sleep(waitMs); - waitMs = Math.min(waitMs * 2, 5000); // exponential backoff, max 5 seconds + waitMs = Math.min(waitMs * 2, 5000); // exponential backoff, + // max 5 seconds } catch (InterruptedException e) { Thread.currentThread().interrupt();