From 20452d381c2390eab71f83a92d9453e362b71ce8 Mon Sep 17 00:00:00 2001 From: sahusanket Date: Wed, 10 Jul 2024 13:34:08 +0530 Subject: [PATCH] PLUGIN-1797 : increase max duration and better logging --- .../java/io/cdap/delta/store/AssessmentServiceClient.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/delta-app/src/main/java/io/cdap/delta/store/AssessmentServiceClient.java b/delta-app/src/main/java/io/cdap/delta/store/AssessmentServiceClient.java index 61e3ef3..42e346c 100644 --- a/delta-app/src/main/java/io/cdap/delta/store/AssessmentServiceClient.java +++ b/delta-app/src/main/java/io/cdap/delta/store/AssessmentServiceClient.java @@ -47,7 +47,7 @@ public class AssessmentServiceClient { private static final Logger LOG = LoggerFactory.getLogger(AssessmentServiceClient.class); private static final int MAX_RETRY_ATTEMPTS_DEFAULT = 50; - private static final Duration MAX_RETRY_DURATION_DEFAULT = Duration.of(3, ChronoUnit.MINUTES); + private static final Duration MAX_RETRY_DURATION_DEFAULT = Duration.of(10, ChronoUnit.MINUTES); private static final int DELAY_MILLIS_DEFAULT = 200; private static final long MAX_DELAY_MILLIS_DEFAULT = TimeUnit.SECONDS.toMillis(30); private static final double JITTER_FACTOR_DEFAULT = 0.20D; @@ -69,8 +69,8 @@ public AssessmentServiceClient(ServiceDiscoverer context, int maxRetryCount, Dur .withBackoff(DELAY_MILLIS_DEFAULT, MAX_DELAY_MILLIS_DEFAULT, ChronoUnit.MILLIS) .withJitter(JITTER_FACTOR_DEFAULT) .onFailedAttempt(failureContext -> { - // log on every fifth attempt - if (failureContext.getAttemptCount() % 5 == 0) { + // log on every Odd failure attempt i.e. 1,3,5 + if ((failureContext.getAttemptCount()+1) % 2 == 0) { LOG.warn("Error in calling assessment service", failureContext.getLastFailure()); } });