Skip to content

Commit c41d634

Browse files
committed
Handle immediate retries better
1 parent 56146af commit c41d634

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

packages/cli-v3/src/entryPoints/managed/execution.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,11 @@ export class RunExecution {
489489
execution,
490490
metrics,
491491
isWarmStart,
492+
isImmediateRetry,
492493
}: WorkloadRunAttemptStartResponseBody & {
493494
metrics: TaskRunExecutionMetrics;
494495
isWarmStart?: boolean;
496+
isImmediateRetry?: boolean;
495497
}) {
496498
this.currentTaskRunEnv = envVars;
497499

@@ -503,6 +505,7 @@ export class RunExecution {
503505
execution,
504506
metrics,
505507
isWarmStart,
508+
isImmediateRetry,
506509
})
507510
);
508511

@@ -557,12 +560,12 @@ export class RunExecution {
557560
execution,
558561
metrics,
559562
isWarmStart,
563+
isImmediateRetry,
560564
}: WorkloadRunAttemptStartResponseBody & {
561565
metrics: TaskRunExecutionMetrics;
562566
isWarmStart?: boolean;
567+
isImmediateRetry?: boolean;
563568
}) {
564-
const isImmediateRetry = !!this.runFriendlyId;
565-
566569
if (isImmediateRetry) {
567570
await this.taskRunProcessProvider.handleImmediateRetry();
568571
}
@@ -781,7 +784,9 @@ export class RunExecution {
781784
return;
782785
}
783786

784-
const [executeError] = await tryCatch(this.executeRunWrapper({ ...start, isWarmStart: true }));
787+
const [executeError] = await tryCatch(
788+
this.executeRunWrapper({ ...start, isWarmStart: true, isImmediateRetry: true })
789+
);
785790

786791
if (executeError) {
787792
this.sendDebugLog("failed to execute run for retry", { error: executeError.message });

0 commit comments

Comments
 (0)