mirror of https://github.com/go-redis/redis.git
Compare commits
2 Commits
06a4de20cf
...
50058e28f2
Author | SHA1 | Date |
---|---|---|
Bhargav Dodla | 50058e28f2 | |
Vladyslav Vildanov | 6866752601 |
9
error.go
9
error.go
|
@ -38,6 +38,15 @@ type Error interface {
|
||||||
|
|
||||||
var _ Error = proto.RedisError("")
|
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 {
|
func shouldRetry(err error, retryTimeout bool) bool {
|
||||||
switch err {
|
switch err {
|
||||||
case io.EOF, io.ErrUnexpectedEOF:
|
case io.EOF, io.ErrUnexpectedEOF:
|
||||||
|
|
|
@ -1321,7 +1321,9 @@ func (c *ClusterClient) processPipelineNode(
|
||||||
_ = node.Client.withProcessPipelineHook(ctx, cmds, func(ctx context.Context, cmds []Cmder) error {
|
_ = node.Client.withProcessPipelineHook(ctx, cmds, func(ctx context.Context, cmds []Cmder) error {
|
||||||
cn, err := node.Client.getConn(ctx)
|
cn, err := node.Client.getConn(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
node.MarkAsFailing()
|
if !isContextError(err) {
|
||||||
|
node.MarkAsFailing()
|
||||||
|
}
|
||||||
_ = c.mapCmdsByNode(ctx, failedCmds, cmds)
|
_ = c.mapCmdsByNode(ctx, failedCmds, cmds)
|
||||||
setCmdsErr(cmds, err)
|
setCmdsErr(cmds, err)
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue