isQueryCancelled checks whether an error string indicates that *some* context cancellation was involved. It does NOT distinguish caller-driven cancellation (Ctrl-C, client disconnect, deadline) from infra-driven cancellation (worker died, CP closed the gRPC client) — both surface here as a wrapped "
(err error)
| 15 | // since infra cancels are real failures we want surfaced. Use |
| 16 | // (*clientConn).isCallerCancellation for that. |
| 17 | func isQueryCancelled(err error) bool { |
| 18 | return err == context.Canceled || (err != nil && strings.Contains(err.Error(), "context canceled")) |
| 19 | } |
| 20 | |
| 21 | // isCallerCancellation reports whether err is a cancellation that the caller |
| 22 | // asked for — either through pgwire CancelRequest, an explicit ctx cancel, or |
no test coverage detected