TheR1sing3un commented on code in PR #12316:
URL: https://github.com/apache/hudi/pull/12316#discussion_r1855825948


##########
hudi-common/src/test/java/org/apache/hudi/common/util/TestRetryHelper.java:
##########
@@ -49,4 +51,19 @@ public void testCheckIfExceptionInRetryList() throws 
Exception {
     retry = (boolean) privateOne.invoke(retryHelper, new 
UnsupportedOperationException("test"));
     assertTrue(retry);
   }
+
+  @Test
+  public void testCheckTooManyTimes() {
+    int maxRetries = 100;
+    RetryHelper retryHelper = new RetryHelper(INTERVAL_TIME, maxRetries, 
INTERVAL_TIME, null);
+    AtomicInteger counter = new AtomicInteger(0);
+    assertDoesNotThrow(() -> {
+      retryHelper.start(() -> {

Review Comment:
   > Maybe we should have another explicit upper threshold instead.
   
   There is already code logic that specifies this upper limit.
   <img width="549" alt="image" 
src="https://github.com/user-attachments/assets/f990ebcf-1f08-4c2a-b45a-aff4aab15531";>
   `getWaitTimeExp` just need to calculate expect max-wait-time (also need to 
avoid long overflow), real-wait-time decides on `Math.min(expect-max-wait-time, 
maxIntervalTime)`, `maxIntervalTime` can be configured.



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

Reply via email to