Skip to content

Commit

Permalink
Merge pull request #91118 from cockroachdb/blathers/backport-release-…
Browse files Browse the repository at this point in the history
…22.2-91097

release-22.2: jobs: do not include nil error into a log message when stepping
  • Loading branch information
yuzefovich authored Nov 2, 2022
2 parents 307989b + dbb36de commit 8afb672
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/jobs/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 8afb672

Please sign in to comment.