From e7a66c1a593c69c818bc122054d687535514c040 Mon Sep 17 00:00:00 2001 From: NorthRealm <155140859+NorthRealm@users.noreply.github.com> Date: Tue, 13 May 2025 13:50:20 +0800 Subject: [PATCH] comment --- services/actions/cleanup.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/services/actions/cleanup.go b/services/actions/cleanup.go index 1f15f84c82..3f55d0c5ac 100644 --- a/services/actions/cleanup.go +++ b/services/actions/cleanup.go @@ -214,9 +214,16 @@ func DeleteRun(ctx context.Context, run *actions_model.ActionRun) error { }) if err := db.WithTx(ctx, func(ctx context.Context) error { - // TODO: https://github.com/go-gitea/gitea/pull/34337#issuecomment-2862222788 - if err0 := CleanupEphemeralRunners(ctx); err0 != nil { - return err0 + // TODO: Deleting task records could break current ephemeral runner implementation. This is a temporary workaround suggested by ChristopherHX. + // Since you delete potentially the only task an ephemeral act_runner has ever run, please delete the affected runners first. + // one of + // call cleanup ephemeral runners first + // delete affected ephemeral act_runners + // I would make ephemeral runners fully delete directly before formally finishing the task + // + // See also: https://github.com/go-gitea/gitea/pull/34337#issuecomment-2862222788 + if err := CleanupEphemeralRunners(ctx); err != nil { + return err } return db.DeleteBeans(ctx, recordsToDelete...) }); err != nil {