Skip to content

bug(v3): maxElapsed timeout boundary bypassed in ExponentialBackoff.execute #3726

Description

@KanhaiyaBagul

Path

packages/core/src/v3/apps/backoff.ts

Description

The ExponentialBackoff helper class exposes an execute() method that handles retrying asynchronous callbacks. While execute() correctly keeps track of the actual wall-clock time spent in the callback using a local elapsedMs variable, this variable is never used to enforce the timeout boundary.
Instead, the retry generator (retryAsync) calculates the elapsed duration by only summing up the sleep delays:

elapsed += delay;
if (elapsed > this.#maxElapsed) {
  break;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions