Skip to content

Commit bf858f4

Browse files
author
deepshekhardas
committed
Fix ExponentialBackoff maxElapsed timeout bypass in execute()
The execute() method tracked elapsedMs across retries but never checked it against maxElapsed, allowing the retry loop to continue indefinitely regardless of the configured time limit.
1 parent d35bf04 commit bf858f4

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,10 @@ export class ExponentialBackoff {
340340
elapsedMs += Date.now() - start;
341341
clearTimeout(attemptTimeout);
342342
}
343+
344+
if (elapsedMs > this.#maxElapsed * 1000) {
345+
break;
346+
}
343347
}
344348

345349
if (finalError instanceof AttemptTimeout) {

0 commit comments

Comments
 (0)