diff --git a/pkg/blockbuilder/builder/builder.go b/pkg/blockbuilder/builder/builder.go index 6d8608bd5d8cb..afc1a4a749530 100644 --- a/pkg/blockbuilder/builder/builder.go +++ b/pkg/blockbuilder/builder/builder.go @@ -279,8 +279,7 @@ func (i *BlockBuilder) runOne(ctx context.Context, c *kgo.Client, workerID strin completion.Success = false } - // remove from inflight jobs to stop sending updates for this job - // to avoid race with completed job requests. + // remove from inflight jobs to stop sending sync requests i.jobsMtx.Lock() delete(i.inflightJobs, job.ID()) i.metrics.inflightJobs.Set(float64(len(i.inflightJobs)))