Skip to content

Commit

Permalink
colexecerror: do not annotate the context canceled error
Browse files Browse the repository at this point in the history
This commit makes it so that the context canceled error doesn't get
annotated with an assertion failure when it doesn't have a valid PG
code. This makes sure that the sentry issues don't get filed for the
context canceled errors - they are expected to occur.

Release note: None
  • Loading branch information
yuzefovich committed Aug 15, 2022
1 parent 91d47e8 commit f17a6cd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/sql/colexecerror/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ func CatchVectorizedRuntimeError(operation func()) (retErr error) {

annotateErrorWithoutCode := true
var nie *notInternalError
if errors.As(err, &nie) {
// A notInternalError was not caused by the vectorized engine and
// represents an error that we don't want to annotate in case it
// doesn't have a valid PG code.
if errors.Is(err, context.Canceled) || errors.As(err, &nie) {
// We don't want to annotate the context cancellation and
// notInternalError errors in case they don't have a valid PG code
// so that the sentry report is not sent (errors with failed
// assertions get sentry reports).
annotateErrorWithoutCode = false
}
if code := pgerror.GetPGCode(err); annotateErrorWithoutCode && code == pgcode.Uncategorized {
Expand Down

0 comments on commit f17a6cd

Please sign in to comment.