From de0e44c6b311bcfa5292bce71e147513e6cf0593 Mon Sep 17 00:00:00 2001 From: Matt Aitken Date: Thu, 8 Feb 2024 15:17:11 +0000 Subject: [PATCH 1/2] Todo for the fix --- apps/webapp/app/services/runs/performRunExecutionV3.server.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/webapp/app/services/runs/performRunExecutionV3.server.ts b/apps/webapp/app/services/runs/performRunExecutionV3.server.ts index 29e4253ec0..5ff9a47047 100644 --- a/apps/webapp/app/services/runs/performRunExecutionV3.server.ts +++ b/apps/webapp/app/services/runs/performRunExecutionV3.server.ts @@ -207,6 +207,8 @@ export class PerformRunExecutionV3Service { forceYieldCoordinator.deregisterRun(run.id); + //todo if cancelled then return + if (!response) { return await this.#failRunExecutionWithRetry( run, From 535802985450c4ffa70286954d4ad75d866167c9 Mon Sep 17 00:00:00 2001 From: Matt Aitken Date: Thu, 8 Feb 2024 16:27:29 +0000 Subject: [PATCH 2/2] =?UTF-8?q?If=20the=20run=20has=20been=20canceled=20du?= =?UTF-8?q?ring=20execution,=20don=E2=80=99t=20do=20any=20further=20proces?= =?UTF-8?q?sing=20of=20the=20run?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/runs/performRunExecutionV3.server.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/webapp/app/services/runs/performRunExecutionV3.server.ts b/apps/webapp/app/services/runs/performRunExecutionV3.server.ts index 5ff9a47047..ad1c282174 100644 --- a/apps/webapp/app/services/runs/performRunExecutionV3.server.ts +++ b/apps/webapp/app/services/runs/performRunExecutionV3.server.ts @@ -207,7 +207,18 @@ export class PerformRunExecutionV3Service { forceYieldCoordinator.deregisterRun(run.id); - //todo if cancelled then return + //if the run has been canceled while it's being executed, we shouldn't do anything more + const updatedRun = await this.#prismaClient.jobRun.findUnique({ + select: { + status: true, + }, + where: { + id: run.id, + }, + }); + if (!updatedRun || updatedRun.status === "CANCELED") { + return; + } if (!response) { return await this.#failRunExecutionWithRetry(