Skip to content

Commit

Permalink
sql: report internal distsql communication error as an internal error
Browse files Browse the repository at this point in the history
related to cockroachdb#31645

Release note: None
  • Loading branch information
vivekmenezes committed Oct 23, 2018
1 parent 9b28709 commit f6c1397
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/sql/distsqlrun/inbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func processInboundStreamHelper(
if err != nil {
if err != io.EOF {
// Communication error.
err = pgerror.NewErrorf(pgerror.CodeConnectionFailureError, "communication error: %s", err)
err = pgerror.NewErrorf(pgerror.CodeInternalError, "communication error: %s", err)
sendErrToConsumer(err)
errChan <- err
return
Expand Down
7 changes: 2 additions & 5 deletions pkg/sql/schema_changer.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,11 @@ func isPermanentSchemaChangeError(err error) bool {
return false
case *pgerror.Error:
switch err.Code {
case pgerror.CodeSerializationFailureError, pgerror.CodeConnectionFailureError:
case pgerror.CodeSerializationFailureError:
return false

case pgerror.CodeInternalError:
if err.Message == context.DeadlineExceeded.Error() {
return false
}

return false
}
}

Expand Down

0 comments on commit f6c1397

Please sign in to comment.