Skip to content

Commit eba2e89

Browse files
committed
Ignore unfreezable states
1 parent 7932bd5 commit eba2e89

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed

apps/webapp/app/v3/services/completeAttempt.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ export class CompleteAttemptService extends BaseService {
252252
},
253253
});
254254

255-
if (!checkpointCreateResult) {
255+
if (!checkpointCreateResult.success) {
256256
logger.error("Failed to create checkpoint", { checkpoint, execution: execution.run.id });
257257

258258
// Update the task run to be failed

apps/webapp/app/v3/services/createCheckpoint.server.ts

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@ export class CreateCheckpointService extends BaseService {
1717
>
1818
): Promise<
1919
| {
20+
success: true;
2021
checkpoint: Checkpoint;
2122
event: CheckpointRestoreEvent;
2223
keepRunAlive: boolean;
2324
}
24-
| undefined
25+
| {
26+
success: false;
27+
keepRunAlive?: boolean;
28+
}
2529
> {
2630
logger.debug(`Creating checkpoint`, params);
2731

@@ -46,7 +50,10 @@ export class CreateCheckpointService extends BaseService {
4650

4751
if (!attempt) {
4852
logger.error("Attempt not found", { attemptFriendlyId: params.attemptFriendlyId });
49-
return;
53+
54+
return {
55+
success: false,
56+
};
5057
}
5158

5259
if (
@@ -64,14 +71,10 @@ export class CreateCheckpointService extends BaseService {
6471
},
6572
});
6673

67-
// This should only affect CLIs < beta.24, in very limited scenarios
68-
const service = new CrashTaskRunService(this._prisma);
69-
await service.call(attempt.taskRunId, {
70-
crashAttempts: true,
71-
reason: "Unfreezable state: Please upgrade your CLI",
72-
});
73-
74-
return;
74+
return {
75+
success: false,
76+
keepRunAlive: true,
77+
};
7578
}
7679

7780
const imageRef = attempt.backgroundWorker.deployment?.imageReference;
@@ -81,7 +84,10 @@ export class CreateCheckpointService extends BaseService {
8184
attemptId: attempt.id,
8285
workerId: attempt.backgroundWorker.id,
8386
});
84-
return;
87+
88+
return {
89+
success: false,
90+
};
8591
}
8692

8793
const checkpoint = await this._prisma.checkpoint.create({
@@ -175,7 +181,10 @@ export class CreateCheckpointService extends BaseService {
175181
checkpointId: checkpoint.id,
176182
});
177183
await marqs?.acknowledgeMessage(attempt.taskRunId);
178-
return;
184+
185+
return {
186+
success: false,
187+
};
179188
}
180189

181190
if (reason.type === "WAIT_FOR_DURATION") {
@@ -191,6 +200,7 @@ export class CreateCheckpointService extends BaseService {
191200
}
192201

193202
return {
203+
success: true,
194204
checkpoint,
195205
event: checkpointEvent,
196206
keepRunAlive,

0 commit comments

Comments
 (0)