Skip to content

Please do not create a redis client on your own #138

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

Closed
Meaglin opened this issue Oct 13, 2016 · 6 comments
Closed

Please do not create a redis client on your own #138

Meaglin opened this issue Oct 13, 2016 · 6 comments

Comments

@Meaglin
Copy link

Meaglin commented Oct 13, 2016

In our project we elegantly close our server by closing all open connections.
Socket.io-redis is breaking this here:
https://github.com/socketio/socket.io-redis/blob/master/index.js#L57
by creating connections without leaving a public reference.

Please fix, we cannot upgrade to the new version because of this.

@darrachequesne
Copy link
Member

@Meaglin as usual, PR is welcome!

@Meaglin
Copy link
Author

Meaglin commented Oct 13, 2016

I understand, but this was not broken before.

@darrachequesne
Copy link
Member

@Meaglin we could maybe add a cleanup method, calling quit() on each redis client, or try to remove the subJson altogether. What do you suggest?

@Meaglin
Copy link
Author

Meaglin commented Oct 13, 2016

I recommend storing references on the client, so people can decide themselves what to do with them

@gboysko
Copy link

gboysko commented Mar 2, 2018

So, is it fair to say that today we still do not have a clean shutdown because the pubClient and subClient each hold open connections to the Redis Server? And there is no propagation from the socket.io Server close to the adapters?

FWIW, I'm still using the 4.0.1 version of socket.io-redis.

@mishelen
Copy link

Agreee.
This is by the way not useless nonsense. Look, for example, on Heroku for one Redis plugin, the amount of memory is fixed, but also a fixed number of connections and no more to receive. When restarting a cluster, there may be unclosed connections. And they will not let it open the new connections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants