Skip to content

Commit

Permalink
Merge #45883
Browse files Browse the repository at this point in the history
45883: changefeedccl: check context errors before logging r=nvanbenschoten a=ajwerner

Fell out of testing changefeeds. Found some of my database row keys in some logs and found scary-looking errors that were really just due to context cancellation. 

Release justification: low-risk change

Release note: None

Co-authored-by: Andrew Werner <[email protected]>
  • Loading branch information
craig[bot] and ajwerner committed Mar 20, 2020
2 parents 744bf85 + 99ea2ac commit a22a085
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/ccl/changefeedccl/changefeed_stmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,9 @@ func (b *changefeedResumer) Resume(
return nil
}
if !IsRetryableError(err) {
if ctx.Err() != nil {
return ctx.Err()
}
log.Warningf(ctx, `CHANGEFEED job %d returning with error: %+v`, jobID, err)
return err
}
Expand All @@ -577,6 +580,9 @@ func (b *changefeedResumer) Resume(
// been updated by the changeFrontier processor since the flow started.
reloadedJob, reloadErr := execCfg.JobRegistry.LoadJob(ctx, jobID)
if reloadErr != nil {
if ctx.Err() != nil {
return ctx.Err()
}
log.Warningf(ctx, `CHANGEFEED job %d could not reload job progress; `+
`continuing from last known high-water of %s: %v`,
jobID, progress.GetHighWater(), reloadErr)
Expand Down

0 comments on commit a22a085

Please sign in to comment.