Skip to content

Commit 7850e44

Browse files
committed
Set the checkpointEventId in marqs when the checkpoint is created for batchTriggerAndWait
This should fix a horrible race condition when at max concurrency
1 parent c183416 commit 7850e44

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,16 @@ export class CreateCheckpointService extends BaseService {
258258
};
259259
}
260260

261+
//if there's a message in the queue, we make sure the checkpoint event is on it
262+
await marqs?.replaceMessage(
263+
attempt.taskRun.id,
264+
{
265+
checkpointEventId: checkpointEvent.id,
266+
},
267+
undefined,
268+
true
269+
);
270+
261271
await ResumeBatchRunService.enqueue(batchRun.id, this._prisma);
262272

263273
return {

0 commit comments

Comments
 (0)