Skip to content

Commit

Permalink
reports success state transition error
Browse files Browse the repository at this point in the history
  • Loading branch information
owen-d committed Jan 14, 2025
1 parent d73f0b5 commit d80dfb8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/blockbuilder/scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d80dfb8

Please sign in to comment.