diff --git a/apps/webapp/app/v3/services/completeAttempt.server.ts b/apps/webapp/app/v3/services/completeAttempt.server.ts index f121f37ab..48ea6d7d5 100644 --- a/apps/webapp/app/v3/services/completeAttempt.server.ts +++ b/apps/webapp/app/v3/services/completeAttempt.server.ts @@ -252,7 +252,7 @@ export class CompleteAttemptService extends BaseService { }, }); - if (!checkpointCreateResult) { + if (!checkpointCreateResult.success) { logger.error("Failed to create checkpoint", { checkpoint, execution: execution.run.id }); // Update the task run to be failed diff --git a/apps/webapp/app/v3/services/createCheckpoint.server.ts b/apps/webapp/app/v3/services/createCheckpoint.server.ts index 0ed9acab5..c9716558b 100644 --- a/apps/webapp/app/v3/services/createCheckpoint.server.ts +++ b/apps/webapp/app/v3/services/createCheckpoint.server.ts @@ -17,11 +17,15 @@ export class CreateCheckpointService extends BaseService { > ): Promise< | { + success: true; checkpoint: Checkpoint; event: CheckpointRestoreEvent; keepRunAlive: boolean; } - | undefined + | { + success: false; + keepRunAlive?: boolean; + } > { logger.debug(`Creating checkpoint`, params); @@ -46,7 +50,10 @@ export class CreateCheckpointService extends BaseService { if (!attempt) { logger.error("Attempt not found", { attemptFriendlyId: params.attemptFriendlyId }); - return; + + return { + success: false, + }; } if ( @@ -64,14 +71,10 @@ export class CreateCheckpointService extends BaseService { }, }); - // This should only affect CLIs < beta.24, in very limited scenarios - const service = new CrashTaskRunService(this._prisma); - await service.call(attempt.taskRunId, { - crashAttempts: true, - reason: "Unfreezable state: Please upgrade your CLI", - }); - - return; + return { + success: false, + keepRunAlive: true, + }; } const imageRef = attempt.backgroundWorker.deployment?.imageReference; @@ -81,7 +84,10 @@ export class CreateCheckpointService extends BaseService { attemptId: attempt.id, workerId: attempt.backgroundWorker.id, }); - return; + + return { + success: false, + }; } const checkpoint = await this._prisma.checkpoint.create({ @@ -175,7 +181,10 @@ export class CreateCheckpointService extends BaseService { checkpointId: checkpoint.id, }); await marqs?.acknowledgeMessage(attempt.taskRunId); - return; + + return { + success: false, + }; } if (reason.type === "WAIT_FOR_DURATION") { @@ -191,6 +200,7 @@ export class CreateCheckpointService extends BaseService { } return { + success: true, checkpoint, event: checkpointEvent, keepRunAlive,