mirror of
https://github.com/redis/go-redis.git
synced 2025-07-25 08:21:55 +03:00
Merge pull request #766 from go-redis/fix/retry-same
cluster: retry same node on retryable error
This commit is contained in:
@ -816,6 +816,12 @@ func (c *ClusterClient) defaultProcess(cmd Cmder) error {
|
||||
}
|
||||
|
||||
if internal.IsRetryableError(err, true) {
|
||||
// Firstly retry the same node.
|
||||
if attempt == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
// Secondly try random node.
|
||||
node, err = c.nodes.Random()
|
||||
if err != nil {
|
||||
break
|
||||
|
Reference in New Issue
Block a user