aryangupta1998 commented on code in PR #8765:
URL: https://github.com/apache/ozone/pull/8765#discussion_r2198351427


##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/HAUtils.java:
##########
@@ -347,21 +348,44 @@ public static List<String> getExistingSstFiles(File db) 
throws IOException {
 
   /**
    * Retry forever until CA list matches expected count.
+   * Fails fast on authentication exceptions.
    * @param task - task to get CA list.
    * @return CA list.
    */
   private static List<String> getCAListWithRetry(Callable<List<String>> task,
       long waitDuration) throws IOException {
-    RetryPolicy retryPolicy = RetryPolicies.retryForeverWithFixedSleep(
-        waitDuration, TimeUnit.SECONDS);
-    RetriableTask<List<String>> retriableTask =
-        new RetriableTask<>(retryPolicy, "getCAList", task);
+    RetryPolicy retryPolicy = new RetryPolicy() {
+      private final RetryPolicy defaultPolicy = 
RetryPolicies.retryForeverWithFixedSleep(
+          waitDuration, TimeUnit.SECONDS);
+
+      @Override
+      public RetryAction shouldRetry(Exception e, int retries, int failovers, 
boolean isIdempotent) throws Exception {
+        if (containsAccessControlException(e)) {
+          return new RetryAction(RetryAction.RetryDecision.FAIL);

Review Comment:
   Just a small suggestion, it might be helpful to add a log message in the 
retry policy when an AccessControlException is encountered. This will make it 
easier to identify missing kinit issues during debugging.
   
   For example:
   ```suggestion
             LOG.warn("AccessControlException encountered during getCAList; 
failing fast without retry.");
             return new RetryAction(RetryAction.RetryDecision.FAIL);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to