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

Function IsSQLRetryableError

pkg/sql/pgwire/pgerror/errors.go:182–193  ·  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

180// TODO(knz): This should really use the errors library. Investigate
181// how to get rid of the error message comparison.
182func IsSQLRetryableError(err error) bool {
183 // Don't forget to update the corresponding test when making adjustments
184 // here.
185 errString := FullError(err)
186 matched, merr := regexp.MatchString(
187 "(no inbound stream connection|connection reset by peer|connection refused|failed to send RPC|rpc error: code = Unavailable|EOF|result is ambiguous)",
188 errString)
189 if merr != nil {
190 return false
191 }
192 return matched
193}

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…