xiangyuf commented on code in PR #23830:
URL: https://github.com/apache/flink/pull/23830#discussion_r1410877781


##########
flink-streaming-java/src/main/java/org/apache/flink/streaming/util/retryable/AsyncRetryStrategies.java:
##########
@@ -181,11 +180,12 @@ public boolean canRetry(int currentAttempts) {
         public long getBackoffTimeMillis(int currentAttempts) {
             if (currentAttempts <= 1) {
                 // equivalent to initial delay
-                return lastRetryDelay;
+                return initialDelay;

Review Comment:
   @lincoln-lil Hi lincoln, thx for comment. AFAIK, cache last value is not 
only problematic when reusing the object but also in situations where user will 
skip some attempts to call `getBackoffTimeMillis`, this will lead to 
inconsistent result for the same input. 
   
   For example, User1 might use getBackoffTimeMillis(1), 
getBackoffTimeMillis(2), getBackoffTimeMillis(4); User2 might use 
getBackoffTimeMillis(1), getBackoffTimeMillis(2), getBackoffTimeMillis(3). The 
getBackoffTimeMillis(4) of User1 will have the same result with the 
getBackoffTimeMillis(3) of User2. 
   
   WDYT?



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to