From d80dfb8cbe1542216a48909248aeef8761111d6c Mon Sep 17 00:00:00 2001 From: Owen Diehl Date: Tue, 14 Jan 2025 14:44:17 -0800 Subject: [PATCH] reports success state transition error --- pkg/blockbuilder/scheduler/scheduler.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/blockbuilder/scheduler/scheduler.go b/pkg/blockbuilder/scheduler/scheduler.go index 2637e67f38695..da64ccf9813ed 100644 --- a/pkg/blockbuilder/scheduler/scheduler.go +++ b/pkg/blockbuilder/scheduler/scheduler.go @@ -263,10 +263,12 @@ func (s *BlockScheduler) HandleCompleteJob(ctx context.Context, job *types.Job, job.Partition(), job.Offsets().Max-1, // max is exclusive, so commit max-1 ); err == nil { - s.queue.TransitionAny(job.ID(), types.JobStatusComplete, func() (*JobWithMetadata, error) { - return NewJobWithMetadata(job, DefaultPriority), nil - }) level.Info(logger).Log("msg", "job completed successfully") + if _, _, transitionErr := s.queue.TransitionAny(job.ID(), types.JobStatusComplete, func() (*JobWithMetadata, error) { + return NewJobWithMetadata(job, DefaultPriority), nil + }); transitionErr != nil { + level.Warn(logger).Log("msg", "failed to mark successful job as complete", "err", transitionErr) + } // TODO(owen-d): cleaner way to enqueue next job for this partition, // don't make it part of the response cycle to job completion, etc.