-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why connection not close when the response is "READONLY error" #790
Comments
Do you use Redis Cluster or Redis Sentinel? |
Thank you for the answer. I am not use Redis Cluster and Redis Sentinel. There are two redis server in my product environment, one is master and another is slave. The redis client use NewClient() to get a client instance and Addr is redis domain name. When redis server role is interchanged, the redis domain name will be mapped to the new master server. New connection will connect to this new master server and wirte operation is OK, but the old connection is response "READONLY error" contineouly. |
So to answer your question - "READONLY error" connections are not closed, because That said your use case makes sense and closing connections on read-only errors is probably fine and should not affect existing code. |
I am certainly seeing your commit and thank you very much for reslove this issue. |
Issue
Firstly I have connected to master redis server and every write operation is OK, but after about one hour, the master and slave redis role interchanged. The write operation on connection with previous master will return "READONLY error" but the connection is not closed and the error is continue. Can we close the connection after receive an error from redis server?
The text was updated successfully, but these errors were encountered: