Skip to content

Commit 9e1d3a6

Browse files
d-csclaude
andcommitted
fix(run-engine): widen unblock transaction limits for batch-scale waitpoints
Pass explicit timeout/maxRetries to $transaction in continueRunIfUnblocked so that large batchTriggerAndWait parents (hundreds of blocking waitpoint rows) don't hit the 5s Prisma default and land in DLQ. Also removes a duplicate post-send debug log, collapses a no-op re-spread in createExecutionSnapshot, and documents that attemptSucceeded callers must pass a plain client. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent eee5d58 commit 9e1d3a6

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

internal-packages/run-engine/src/engine/systems/executionSnapshotSystem.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -491,11 +491,7 @@ export class ExecutionSnapshotSystem {
491491
completedWaitpoints: args.completedWaitpoints,
492492
});
493493

494-
return {
495-
...newSnapshot,
496-
friendlyId: newSnapshot.friendlyId,
497-
runFriendlyId: newSnapshot.runFriendlyId,
498-
};
494+
return newSnapshot;
499495
}
500496

501497
public async heartbeatRun({

internal-packages/run-engine/src/engine/systems/runAttemptSystem.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,9 @@ export class RunAttemptSystem {
688688
runId: string;
689689
snapshotId: string;
690690
completion: TaskRunSuccessfulExecutionResult;
691+
// Note: passing an open transaction as `tx` makes $transaction run inline in it,
692+
// which would move this method's post-commit side effects inside the caller's
693+
// transaction. Callers must pass a plain client.
691694
tx: PrismaClientOrTransaction;
692695
workerId?: string;
693696
runnerId?: string;

internal-packages/run-engine/src/engine/systems/waitpointSystem.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,12 @@ export class WaitpointSystem {
884884
message: error.message,
885885
runId,
886886
});
887+
},
888+
{
889+
// the m2m connect inserts one row per blocking waitpoint, so large
890+
// batchTriggerAndWait parents need more than the 5s default
891+
timeout: 30_000,
892+
maxRetries: 2,
887893
}
888894
);
889895

@@ -914,11 +920,6 @@ export class WaitpointSystem {
914920
eventBus: this.$.eventBus,
915921
});
916922

917-
this.$.logger.debug(`continueRunIfUnblocked: removed blocking waitpoints`, {
918-
runId,
919-
blockingWaitpoints,
920-
});
921-
922923
return {
923924
status: "unblocked",
924925
waitpoints: blockingWaitpoints.map((w) => w.waitpoint),

0 commit comments

Comments
 (0)