From 5af0e4210d70aa6c9dc0bc2b083f837e700d9280 Mon Sep 17 00:00:00 2001 From: Dmitry Meyer Date: Thu, 5 Feb 2026 14:18:08 +0000 Subject: [PATCH] [runner] Write termination_{reason,message} to the log --- runner/internal/executor/base.go | 4 ++-- runner/internal/executor/executor.go | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/runner/internal/executor/base.go b/runner/internal/executor/base.go index 4961180e9..99e32250c 100644 --- a/runner/internal/executor/base.go +++ b/runner/internal/executor/base.go @@ -18,8 +18,8 @@ type Executor interface { SetJobStateWithTerminationReason( ctx context.Context, state types.JobState, - termination_reason types.TerminationReason, - termination_message string, + terminationReason types.TerminationReason, + terminationMessage string, ) SetRunnerState(state string) WriteFileArchive(id string, src io.Reader) error diff --git a/runner/internal/executor/executor.go b/runner/internal/executor/executor.go index cd3bd1be9..ea2ef6393 100644 --- a/runner/internal/executor/executor.go +++ b/runner/internal/executor/executor.go @@ -296,7 +296,7 @@ func (ex *RunExecutor) SetJobState(ctx context.Context, state types.JobState) { } func (ex *RunExecutor) SetJobStateWithTerminationReason( - ctx context.Context, state types.JobState, termination_reason types.TerminationReason, termination_message string, + ctx context.Context, state types.JobState, terminationReason types.TerminationReason, terminationMessage string, ) { ex.mu.Lock() ex.jobStateHistory = append( @@ -304,11 +304,14 @@ func (ex *RunExecutor) SetJobStateWithTerminationReason( schemas.JobStateEvent{ State: state, Timestamp: ex.timestamp.Next(), - TerminationReason: termination_reason, - TerminationMessage: termination_message, + TerminationReason: terminationReason, + TerminationMessage: terminationMessage, }, ) ex.mu.Unlock() + if terminationReason != "" { + ctx = log.AppendArgsCtx(ctx, "termination_reason", terminationReason, "termination_message", terminationMessage) + } log.Info(ctx, "Job state changed", "new", state) }