lincoln-lil commented on code in PR #23830:
URL: https://github.com/apache/flink/pull/23830#discussion_r1410826099
##########
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:
I remembered that the original version was expecting to avoid `pow`
evaluation by cache last value, but this was problematic due to the lack of a
reset when reusing the object.
I see another way to fix is to add `reset` here:
```java
// reset to initialDelay
this.lastRetryDelay = initialDelay;
return lastRetryDelay;
```
WDYT?
##########
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:
I remembered that the original version was expecting to avoid `pow`
evaluation by cache last value, but this was problematic due to the lack of a
reset when reusing the object.
I see another way to fix is to add `reset` here:
```java
// reset to initialDelay
this.lastRetryDelay = initialDelay;
return lastRetryDelay;
```
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]