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
Subscriber clients won't reconnect #1451
Comments
The issue is most likely that there's no keepAlive configured. And for the keepalive itself we have another issue open: #1339 |
question is why isn't a connection abort detected? I think it should resubscribe. |
Could you test that with ioredis v5? most likely we don't know about the disconnect until some I/O happens. Fixing keepalive should get that working more reliably. |
Is this somehow tackled at the moment? The README says that a subscribed client will resubscribe to a channel, but for this the connection loss must be detected. The ping trick does its thing, but it would be cooler if a connection loss would be detected. |
A fix for the keepalive landed on the 31. of march #1554 |
Ah I see. We use node.js LTS Version, which is 16.x. AFAICT, this would work with node >= 17.7.0, right? |
The applied fix in ioredis v5.0.3 should work for all the node.js versions. |
Closing as we can assume the keepalive change fixed it |
Subscriber clients won't reconnect after a timeout when redis server removes the client based on
tcp-keepalive
setting (default is 300 seconds).This is only related to a remote redis connection. Locally it works.
I ran into this because I put my system to sleep instead of shutting it down. But instead of sleep it could be a broken uplink, switch failure, power outage and so on.
The subscriber should automatically reconnect, but in this case he doesn't.
Reproduce
tcp-keepalive
value) or put your system to sleep/hibernatetcp-keepalive
value on your redis serverI noticed that the error event for the subscriber doesn't get fired every time.
My working fix
Ping the server regularly.
The text was updated successfully, but these errors were encountered: