Skip to content

Commit 7f7d24a

Browse files
committed
fix(run-engine): treat delay=0 as immediate retry, not no-retry
calculateNextRetryDelay() returns undefined when retries are exhausted and a number (including 0) when a retry should happen. The !delay guard was coercing 0 to false, causing runs configured with an immediate retry (delay of 0ms) to be treated as having no retries left and failed prematurely. Switch to explicit undefined checks in both the OOM retry path and the general retry path.
1 parent 185d564 commit 7f7d24a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎internal-packages/run-engine/src/engine/retrying.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export async function retryOutcomeFromCompletion(
6767

6868
const delay = calculateNextRetryDelay(oomResult.retrySettings, attemptNumber ?? 1);
6969

70-
if (!delay) {
70+
if (delay === undefined) {
7171
//no more retries left
7272
return { outcome: "fail_run", sanitizedError, wasOOMError: true };
7373
}
@@ -180,7 +180,7 @@ export function retrySettingsFromLockedConfig(
180180

181181
const nextDelay = calculateNextRetryDelay(parsedRetryConfig.data, attemptNumber ?? 1);
182182

183-
if (!nextDelay) {
183+
if (nextDelay === undefined) {
184184
return;
185185
}
186186

0 commit comments

Comments
 (0)