This commit is contained in:
Bhargav Dodla 2024-11-21 12:26:43 -08:00 committed by GitHub
commit ce2976f1c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

View File

@ -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:

View File

@ -1344,7 +1344,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