-
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
Extreme amount of ioredisClusterSubscriber clients #1325
Labels
Comments
Hey @GaryWilber, thanks for reporting this issue! I can confirm this is a bug and I'm working on a fix. |
luin
added a commit
that referenced
this issue
Apr 8, 2021
luin
added a commit
that referenced
this issue
Apr 8, 2021
🎉 This issue has been resolved in version 4.26.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
janus-dev87
added a commit
to janus-dev87/ioredis-work
that referenced
this issue
Mar 1, 2024
# [4.26.0](redis/ioredis@v4.25.0...v4.26.0) (2021-04-08) ### Bug Fixes * **cluster:** subscriber connection leaks ([81b9be0](redis/ioredis@81b9be0)), closes [#1325](redis/ioredis#1325) ### Features * **cluster:** apply provided connection name to internal connections ([2e388db](redis/ioredis@2e388db))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a service using ioredis 4.24.6 and recently ran a stress test against it, which ended up maxing out the redis cluster cpu.
While the Redis cluster cpu was 100%, the ioredis cluster clients started disconnecting / reconnecting.
In the redis server telemetry, the client count continued to increase until it hit the maximum number of clients allowed.
Running
CLIENT LIST
on the redis shard returns over one thousandioredisClusterSubscriber
clients. This is much higher than the amount of redis clients I would expect.Based on this, I suspect there is some bug in the ClusterSubscriber code that is causing client/connection leaks when a Redis cluster has high cpu / command timeouts.
Please correct me if I'm wrong but based on a preliminary look through of that code, I'm suspicious of the
this.subscriber
/this.lastActiveSubscriber
properties.In that event that
selectSubscriber
is called and fails to resubscribe to the previous channels,this.lastActiveSubscriber = this.subscriber
is never called. This means that ifselectSubscriber
is called again, it will create another subscriber while leaving the previous one alive forever.Can someone knowledgeable check and confirm that? I think the follow-up items are:
ClusterSubscriber
leaking connectionsioredisClusterSubscriber
. In my case, I have aconnectionName
set on the ioredis cluster client. Could we make theClusterSubscriber
connection name appendioredisClusterSubscriber
to the end of the main client? This would make it easier to debug viaCLIENT LIST
.The text was updated successfully, but these errors were encountered: