From 6dd305f8b4ba2385791b14ba32eeff12514c068f Mon Sep 17 00:00:00 2001 From: danoswaltCL <97542869+danoswaltCL@users.noreply.github.com> Date: Mon, 9 Oct 2023 15:26:23 -0400 Subject: [PATCH 1/2] no retries on 4xx, max_retries=1 --- .../org/upgradeplatform/utils/PublishingRetryCallback.java | 6 +++++- .../java/src/main/java/org/upgradeplatform/utils/Utils.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/clientlibs/java/src/main/java/org/upgradeplatform/utils/PublishingRetryCallback.java b/clientlibs/java/src/main/java/org/upgradeplatform/utils/PublishingRetryCallback.java index 1b57e4ef33..41bc619726 100644 --- a/clientlibs/java/src/main/java/org/upgradeplatform/utils/PublishingRetryCallback.java +++ b/clientlibs/java/src/main/java/org/upgradeplatform/utils/PublishingRetryCallback.java @@ -7,6 +7,7 @@ import javax.ws.rs.core.Response; import static javax.ws.rs.core.Response.Status.Family.SUCCESSFUL; +import static javax.ws.rs.core.Response.Status.Family.CLIENT_ERROR; public class PublishingRetryCallback implements InvocationCallback { @@ -35,7 +36,10 @@ public PublishingRetryCallback(AsyncInvoker invoker, Entity message, int retr @Override public void completed(Response response) { - if (SUCCESSFUL.equals(response.getStatusInfo().getFamily()) || retries <= 0) { + boolean isSuccess = SUCCESSFUL.equals(response.getStatusInfo().getFamily()); + boolean isClientRequestError = CLIENT_ERROR.equals(response.getStatusInfo().getFamily()); + + if (isSuccess || isClientRequestError || retries <= 0) { callback.completed(response); } else { retry(); diff --git a/clientlibs/java/src/main/java/org/upgradeplatform/utils/Utils.java b/clientlibs/java/src/main/java/org/upgradeplatform/utils/Utils.java index aea88d1e87..178971926f 100644 --- a/clientlibs/java/src/main/java/org/upgradeplatform/utils/Utils.java +++ b/clientlibs/java/src/main/java/org/upgradeplatform/utils/Utils.java @@ -33,7 +33,7 @@ public class Utils public static final String PATCH = "PATCH"; - public static final int MAX_RETRIES = 3; + public static final int MAX_RETRIES = 1; public static enum RequestType { From 72b3783c43e3a2e4c39de84575eeb4f1830a3833 Mon Sep 17 00:00:00 2001 From: danoswaltCL <97542869+danoswaltCL@users.noreply.github.com> Date: Mon, 9 Oct 2023 15:30:45 -0400 Subject: [PATCH 2/2] pom version --- clientlibs/java/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clientlibs/java/pom.xml b/clientlibs/java/pom.xml index 82bdb2e9f8..0c3b559425 100644 --- a/clientlibs/java/pom.xml +++ b/clientlibs/java/pom.xml @@ -8,8 +8,8 @@ changed in the next comment. that increases the likelihood that two PRs in-flight at the same time that happen to rev to the same new version will be caught by a merge conflict. --> - - 3.1.4 + + 3.1.5