-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
ioredis fails to connect to cluster #586
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 7 days if no further activity occurs, but feel free to re-open a closed issue if needed. |
Ping. It would be good to fix this issue. I've written some rather kludgy code in my client to periodically (~3 seconds) check if connected and if not destroy that ioredis Cluster instance and create a new one, but it isn't the cleanest solution at all. The library really needs to handle this scenario. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 7 days if no further activity occurs, but feel free to re-open a closed issue if needed. |
Commenting to keep this issue open. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 7 days if no further activity occurs, but feel free to re-open a closed issue if needed. |
@luin Any chance this will be addressed? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 7 days if no further activity occurs, but feel free to re-open a closed issue if needed. |
unstale |
@ccs018 you say you are using ioredis 3.2.2? Have you tried any newer versions of ioredis just to see if it's already fixed? |
Unfortunately, no. The project I was on that was using Redis Clusters was cancelled in August. I did scan through the changelog and there appeared to have been a number of interesting updates, but I am not able to verify if these resolve the original issue. Before the project was cancelled I had a work-around that would timeout and kill the ioredis instance if no connections were made and then create a new instance. It was klugey, but it worked. I don't know if you want to leave this open and attempt to reproduce the issue or if you'd just like to close it. Given the number of changes in ioredis 4.x and since my project was cancelled, I have no objections if you close it. |
Using Redis 4.0.8 & ioredis 3.2.2. I am standing up a Redis Cluster with 3 shards & 2 nodes per shard. In my environment, the Redis Nodes and the Redis Client start asynchronously. When the client attempts to connect to the nodes in the cluster, not all of the nodes have yet been started and the nodes haven't actually yet formed the cluster (i.e., redis-trib.rb hasn't yet been executed). When this happens, ioredis never appears to recover and never connects to the cluster even after the cluster has been formed. If I restart the client (after the cluster has been formed), then the client successfully connects to the cluster. Forcing the client to wait until after the cluster has been formed would be kludgey.
Part of the problem appears to be that the 'delay' value reported in the 'reconnecting' event is undefined and therefore ioredis never attempts to reconnect.
Additionally, the following non-default options are specified:
Below are the logs from the client:
A
ready
event is never received.The text was updated successfully, but these errors were encountered: