From 5f652c6212728c170f12d95484587b425dd89df9 Mon Sep 17 00:00:00 2001 From: Matt Aitken Date: Tue, 11 Feb 2025 11:01:21 +0000 Subject: [PATCH] Complete the original attempt span if retrying due to an OOM --- .../app/v3/services/completeAttempt.server.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/apps/webapp/app/v3/services/completeAttempt.server.ts b/apps/webapp/app/v3/services/completeAttempt.server.ts index fe18c5c29..8bab150c2 100644 --- a/apps/webapp/app/v3/services/completeAttempt.server.ts +++ b/apps/webapp/app/v3/services/completeAttempt.server.ts @@ -285,6 +285,23 @@ export class CompleteAttemptService extends BaseService { machinePreset: retryConfig.outOfMemory.machine, }, }); + + //complete the attempt span + await eventRepository.completeEvent(taskRunAttempt.taskRun.spanId, { + endTime: failedAt, + attributes: { + isError: true, + }, + events: [ + { + name: "exception", + time: failedAt, + properties: { + exception: createExceptionPropertiesFromError(sanitizedError), + }, + }, + ], + }); } }