From dbb36de103f8f7d2414f268d24d9d4fa2b4e15f3 Mon Sep 17 00:00:00 2001 From: Yahor Yuzefovich Date: Tue, 1 Nov 2022 21:10:03 +0000 Subject: [PATCH] jobs: do not include nil error into a log message when stepping This is a bit annoying and makes things a bit more difficult to search for actual errors. Epic: None Release note: None --- pkg/jobs/registry.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/jobs/registry.go b/pkg/jobs/registry.go index 4964f14493fc..a9c13030d0de 100644 --- a/pkg/jobs/registry.go +++ b/pkg/jobs/registry.go @@ -1205,7 +1205,11 @@ func (r *Registry) stepThroughStateMachine( ) error { payload := job.Payload() jobType := payload.Type() - log.Infof(ctx, "%s job %d: stepping through state %s with error: %+v", jobType, job.ID(), status, jobErr) + if jobErr != nil { + log.Infof(ctx, "%s job %d: stepping through state %s with error: %+v", jobType, job.ID(), status, jobErr) + } else { + log.Infof(ctx, "%s job %d: stepping through state %s", jobType, job.ID(), status) + } jm := r.metrics.JobMetrics[jobType] onExecutionFailed := func(cause error) error { log.InfofDepth(