Skip to content

Commit

Permalink
Merge #98714
Browse files Browse the repository at this point in the history
98714: jobs: missing error return in job stats poller r=knz a=adityamaru

Previously, we were swallowing the error, if any, when loading the schedule before processing it. This error could be a txn retry error that needs to be surfaced to the client so that the txn is retried correctly.

Fixes: #98629

Release note: None

Co-authored-by: adityamaru <[email protected]>
  • Loading branch information
craig[bot] and adityamaru committed Mar 16, 2023
2 parents d6bef5e + ad904b5 commit d68f5cd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/jobs/metricspoller/job_statistics.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,11 @@ func processSchedulePTSRecord(
) error {
sj, err := jobs.ScheduledJobTxn(txn).
Load(ctx, scheduledjobs.ProdJobSchedulerEnv, scheduleID)
if jobs.HasScheduledJobNotFoundError(err) {
return nil // nolint:returnerrcheck -- schedule maybe deleted when we run; just keep going.
if err != nil {
if jobs.HasScheduledJobNotFoundError(err) {
return nil // nolint:returnerrcheck -- schedule maybe deleted when we run; just keep going.
}
return err
}
ex, err := jobs.GetScheduledJobExecutor(sj.ExecutorType())
if err != nil {
Expand Down

0 comments on commit d68f5cd

Please sign in to comment.