From 13d530302e5f8203b0f104155eb6e136f5aaf910 Mon Sep 17 00:00:00 2001 From: Markus Wolf Date: Tue, 27 Sep 2022 21:13:32 +0200 Subject: [PATCH] fix: restore the job logger setup after job cancelation (#1365) To be able to tag all log-lines with appropriate fields after a workflow run is canceled, we need to restore the JobLogger in the cancelation context. --- pkg/runner/job_executor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/runner/job_executor.go b/pkg/runner/job_executor.go index 8cf87a4..5c3e3b1 100644 --- a/pkg/runner/job_executor.go +++ b/pkg/runner/job_executor.go @@ -108,7 +108,7 @@ func newJobExecutor(info jobInfo, sf stepFactory, rc *RunContext) common.Executo if ctx.Err() == context.Canceled { // in case of an aborted run, we still should execute the // post steps to allow cleanup. - ctx, cancel = context.WithTimeout(context.Background(), 5*time.Minute) + ctx, cancel = context.WithTimeout(WithJobLogger(context.Background(), rc.Run.JobID, rc.String(), rc.Config, &rc.Masks, rc.Matrix), 5*time.Minute) defer cancel() } return postExecutor(ctx)