Closed youfeiyou closed 1 year ago
Hi You.
The option max_retry_count
is only used for redirects and -TRYAGAIN responses. There is no retry for other errors.
Why? Because we don't know if the command has been executed on the Redis node or not before the error happened. For some commands like INCR or LPUSH it is not safe to run them twice.
Maybe we can implement automatic retry for some commands where it it safe to do it, but for now I think you will need to do retry in a loop in your code.
ok ,thank you, i wll try it
hello, i have a redis cluster with three master and three slave. when one master or slave node is down, function
command()
will return error "server closed connection". i try to set retry option but useless, is there any ways to solve it? thanks (my request way is Synchronous blocking )