Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! review suggestions
  • Loading branch information
ashwanthgoli committed Nov 25, 2024
commit 7128249c8e6931a17982a8296e8a09d9d5837b1e
11 changes: 7 additions & 4 deletions pkg/blockbuilder/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ func (l *PartitionJobController) Process(ctx context.Context, offsets Offsets, c
converted := make([]AppendInput, 0, len(records))
for _, record := range records {
if record.Offset >= offsets.Max {
level.Debug(l.logger).Log("msg", "record offset exceeds job max offset. stop processing", "record offset", record.Offset, "max offset", offsets.Max)
break
}
lastOffset = record.Offset
Expand All @@ -173,10 +174,12 @@ func (l *PartitionJobController) Process(ctx context.Context, offsets Offsets, c
})
}

select {
case ch <- converted:
case <-ctx.Done():
return 0, ctx.Err()
if len(converted) > 0 {
select {
case ch <- converted:
case <-ctx.Done():
return 0, ctx.Err()
}
}
}

Expand Down