Skip to content

Commit ade9163

Browse files
committed
fix(server): a setup retry only releases holds from its own failure
1 parent 3dbeab4 commit ade9163

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎apps/server/src/orchestration-v2/Orchestrator.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8114,9 +8114,11 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio
81148114
type: "run.updated",
81158115
payload: { ...state.run, status: "preparing", completedAt: null },
81168116
});
8117-
// Messages held when this preparation failed follow the run again.
8117+
// Messages held when this preparation failed follow the run again. A hold
8118+
// from a later run (a stop, say) is not this failure's to release.
8119+
const failureOwnsQueue = latestExecutedRun(projection.runs)?.id === state.run.id;
81188120
for (const run of projection.runs) {
8119-
if (run.status !== "queued" || run.queueHeld !== true) continue;
8121+
if (!failureOwnsQueue || run.status !== "queued" || run.queueHeld !== true) continue;
81208122
yield* emitEvent({
81218123
type: "run.updated",
81228124
threadId: command.threadId,

0 commit comments

Comments
 (0)