File tree Expand file tree Collapse file tree
internal-packages/run-engine/src/engine/systems Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -925,6 +925,11 @@ export class WaitpointSystem {
925925 waitpoints : blockingWaitpoints . map ( ( w ) => w . waitpoint ) ,
926926 } ;
927927 }
928+ // Unlike EXECUTING_WITH_WAITPOINTS above, this case is deliberately NOT
929+ // wrapped in a single transaction: enqueueRun performs Redis queue work
930+ // internally, which must never run inside an open Postgres transaction.
931+ // Its snapshot insert and the post-switch waitpoint deletion below stay
932+ // separate statements, as they were before the transactional refactor.
928933 case "SUSPENDED" : {
929934 if ( ! snapshot . checkpointId ) {
930935 // A run canceled mid-suspend has its checkpoint cleared by the
@@ -980,6 +985,8 @@ export class WaitpointSystem {
980985 }
981986 }
982987
988+ // Only the SUSPENDED case reaches here — EXECUTING_WITH_WAITPOINTS returns
989+ // above after deleting its waitpoints inside its transaction.
983990 if ( blockingWaitpoints . length > 0 ) {
984991 //5. Remove the blocking waitpoints
985992 await this . $ . prisma . taskRunWaitpoint . deleteMany ( {
You can’t perform that action at this time.
0 commit comments