-
-
Notifications
You must be signed in to change notification settings - Fork 577
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
Simple request: allow disconnecting all users #56
Comments
Empty string already used as a sign to make operation with all things - in |
Can make this empty string |
Yeah so this is not as simple as I thought - I assumed disconnect already sent message back to client. So let me re-state what I actually want rather than just suggest we change this existing feature. What would be useful in some cases would be te ability to put a whole centrifguo cluster into "load shedding" mode where they:
The motivation is that in real-world we see clients still connected weeks after stopping a load test of centrifugo. For example, I ran a load test which had about 50k users connected and I still see about 100 users connected now - over a week since I stopped including JS on the page that makes the connections! For first 24 hours after load test it's in the thousands. One way to achieve this would be to have some application property that is checked on each request (like config properties are) and then just make and admin API to toggle it with enough warnings about how destructive it is. Honestly not sure if it's worth it though if it's relatively hard to do. There are other ways to acheive same thing - alter HMAC secret and restart for a while so that all the reconnects are failed permenantly due to bad auth for example. (not tried that but I assume it would work). |
Trick with altering secret should help. There is already shutdown method called when SIGINT received. And shutdown property in application. Maybe try to make shutdown as button in web interface? At moment on shutdown connections just closed - so will reconnect, maybe shutdown with optional reconnect flag? But anyway there may be some users that have not processed disconnect message and will try to reconnect. |
Closing with |
There is already an admin API for disconnecting specified user.
In some cases (handling outages/load testing) it can be useful to explicitly disconnect all current users such that they won't attempt to reconnect indefinitely (in the wild we always have some people who leave the page open for days and days).
It's not vital, but it would be useful in these cases to be able to force-disconnect every user.
Could support empty userid param, but probably better would be something explicit like
**
so it can't be done accidentally...The text was updated successfully, but these errors were encountered: