jugomezv commented on code in PR #10777:
URL: https://github.com/apache/pinot/pull/10777#discussion_r1204822195


##########
pinot-spi/src/main/java/org/apache/pinot/spi/utils/retry/BaseRetryPolicy.java:
##########
@@ -42,26 +42,26 @@ protected BaseRetryPolicy(int maxNumAttempts) {
   protected abstract long getDelayMs(int currentAttempt);
 
   @Override
-  public void attempt(Callable<Boolean> operation)
+  public int attempt(Callable<Boolean> operation)
       throws AttemptsExceededException, RetriableOperationException {
     int attempt = 0;
     try {
       while (attempt < _maxNumAttempts - 1) {
         if (Boolean.TRUE.equals(operation.call())) {
           // Succeeded
-          return;
+          return attempt;
         } else {
           // Failed
           Thread.sleep(getDelayMs(attempt++));
         }
       }
       if (_maxNumAttempts > 0 && Boolean.TRUE.equals(operation.call())) {
         // Succeeded
-        return;
+        return attempt;
       }
     } catch (Exception e) {
-      throw new RetriableOperationException(e);
+      throw new RetriableOperationException(e, attempt + 1);
     }
-    throw new AttemptsExceededException("Operation failed after " + 
_maxNumAttempts + " attempts");
+    throw new AttemptsExceededException("Operation failed after " + 
_maxNumAttempts + " attempts", attempt);

Review Comment:
   done



-- 
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