You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "lincoln lee (Jira)" <ji...@apache.org> on 2023/12/02 01:02:00 UTC
[jira] [Closed] (FLINK-33698) Fix the backoff time calculation in ExponentialBackoffDelayRetryStrategy
[ https://issues.apache.org/jira/browse/FLINK-33698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
lincoln lee closed FLINK-33698.
-------------------------------
Fix Version/s: 1.19.0
Resolution: Fixed
fixed in master: 5da214c963c219c8b3da727ffde5d6995b3770b8
> Fix the backoff time calculation in ExponentialBackoffDelayRetryStrategy
> ------------------------------------------------------------------------
>
> Key: FLINK-33698
> URL: https://issues.apache.org/jira/browse/FLINK-33698
> Project: Flink
> Issue Type: Bug
> Components: API / DataStream
> Reporter: xiangyu feng
> Assignee: xiangyu feng
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.19.0
>
>
> The backoff time calculation in `ExponentialBackoffDelayRetryStrategy` should consider currentAttempts.
>
> Current Version:
> {code:java}
> @Override
> public long getBackoffTimeMillis(int currentAttempts) {
> if (currentAttempts <= 1) {
> // equivalent to initial delay
> return lastRetryDelay;
> }
> long backoff = Math.min((long) (lastRetryDelay * multiplier), maxRetryDelay);
> this.lastRetryDelay = backoff;
> return backoff;
> } {code}
> Fixed Version:
> {code:java}
> @Override
> public long getBackoffTimeMillis(int currentAttempts) {
> if (currentAttempts <= 1) {
> // equivalent to initial delay
> return initialDelay;
> }
> long backoff =
> Math.min(
> (long) (initialDelay * Math.pow(multiplier, currentAttempts - 1)),
> maxRetryDelay);
> return backoff;
> } {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)