mirror of
https://github.com/redis/go-redis.git
synced 2025-07-31 05:04:23 +03:00
fix: Fixed issue with context cancelled error leading to connection spikes on Primary instances (#3190)
* fix: Fixed issue with context cancelled error leading to connection spikes on Master * fix: Added tests * fix: Updated tests --------- Co-authored-by: Bhargav Dodla <bdodla@expediagroup.com> Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
This commit is contained in:
9
error.go
9
error.go
@ -38,6 +38,15 @@ type Error interface {
|
||||
|
||||
var _ Error = proto.RedisError("")
|
||||
|
||||
func isContextError(err error) bool {
|
||||
switch err {
|
||||
case context.Canceled, context.DeadlineExceeded:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func shouldRetry(err error, retryTimeout bool) bool {
|
||||
switch err {
|
||||
case io.EOF, io.ErrUnexpectedEOF:
|
||||
|
Reference in New Issue
Block a user