MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / IsSQLRetryableError

Function IsSQLRetryableError

pkg/sql/pgwire/pgerror/errors.go:158–169  ·  view source on GitHub ↗

IsSQLRetryableError returns true if err is retryable. This is true for errors that show a connection issue or an issue with the node itself. This can occur when a node is restarting or is unstable in some other way. Note that retryable errors may occur event in cases where the SQL execution ran to c

(err error)

Source from the content-addressed store, hash-verified

156// TODO(knz): This should really use the errors library. Investigate
157// how to get rid of the error message comparison.
158func IsSQLRetryableError(err error) bool {
159 // Don't forget to update the corresponding test when making adjustments
160 // here.
161 errString := FullError(err)
162 matched, merr := regexp.MatchString(
163 "(no inbound stream connection|connection reset by peer|connection refused|failed to send RPC|rpc error: code = Unavailable|(^|\\s)EOF|result is ambiguous)",
164 errString)
165 if merr != nil {
166 return false
167 }
168 return matched
169}

Callers

nothing calls this directly

Calls 1

FullErrorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…