mirror of https://github.com/go-redis/redis.git
Compare commits
3 Commits
ce2976f1c9
...
8e77cfdcb1
Author | SHA1 | Date |
---|---|---|
Bhargav Dodla | 8e77cfdcb1 | |
Bhargav Dodla | 50058e28f2 | |
Vladyslav Vildanov | 6866752601 |
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:
|
||||
|
|
|
@ -1344,7 +1344,9 @@ func (c *ClusterClient) processPipelineNode(
|
|||
_ = node.Client.withProcessPipelineHook(ctx, cmds, func(ctx context.Context, cmds []Cmder) error {
|
||||
cn, err := node.Client.getConn(ctx)
|
||||
if err != nil {
|
||||
node.MarkAsFailing()
|
||||
if !isContextError(err) {
|
||||
node.MarkAsFailing()
|
||||
}
|
||||
_ = c.mapCmdsByNode(ctx, failedCmds, cmds)
|
||||
setCmdsErr(cmds, err)
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue