Skip to content

Commit

Permalink
fix: corrupted rsources stats captured by processor for dropped jobs (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
atzoum authored Oct 19, 2023
1 parent 978c292 commit e7b829d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions processor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -2566,10 +2566,13 @@ func (proc *Handle) transformSrcDest(
}
}

func (proc *Handle) saveDroppedJobs(failedJobs []*jobsdb.JobT, tx *jobsdb.Tx) error {
if len(failedJobs) > 0 {
func (proc *Handle) saveDroppedJobs(droppedJobs []*jobsdb.JobT, tx *jobsdb.Tx) error {
if len(droppedJobs) > 0 {
for i := range droppedJobs { // each dropped job should have a unique jobID in the scope of the batch
droppedJobs[i].JobID = int64(i)
}
rsourcesStats := rsources.NewDroppedJobsCollector(proc.rsourcesService)
rsourcesStats.JobsDropped(failedJobs)
rsourcesStats.JobsDropped(droppedJobs)
return rsourcesStats.Publish(context.TODO(), tx.Tx)
}
return nil
Expand Down

0 comments on commit e7b829d

Please sign in to comment.