{"action":"created","issue":{"url":"https://api.github.com/repos/centrifugal/centrifugo/issues/56","labels_url":"https://api.github.com/repos/centrifugal/centrifugo/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/centrifugal/centrifugo/issues/56/comments","events_url":"https://api.github.com/repos/centrifugal/centrifugo/issues/56/events","html_url":"https://github.com/centrifugal/centrifugo/issues/56","id":123655401,"number":56,"title":"Simple request: allow disconnecting all users","user":{"login":"banks","id":120915,"avatar_url":"https://avatars.githubusercontent.com/u/120915?v=3","gravatar_id":"","url":"https://api.github.com/users/banks","html_url":"https://github.com/banks","followers_url":"https://api.github.com/users/banks/followers","following_url":"https://api.github.com/users/banks/following{/other_user}","gists_url":"https://api.github.com/users/banks/gists{/gist_id}","starred_url":"https://api.github.com/users/banks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/banks/subscriptions","organizations_url":"https://api.github.com/users/banks/orgs","repos_url":"https://api.github.com/users/banks/repos","events_url":"https://api.github.com/users/banks/events{/privacy}","received_events_url":"https://api.github.com/users/banks/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/centrifugal/centrifugo/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-23T12:52:30Z","updated_at":"2015-12-30T16:30:43Z","closed_at":null,"body":"There is already an admin API for disconnecting specified user.\r\n\r\nIn 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).\r\n\r\nIt's not vital, but it would be useful in these cases to be able to force-disconnect every user.\r\n\r\nCould support empty userid param, but probably better would be something explicit like `**` so it can't be done accidentally..."},"comment":{"url":"https://api.github.com/repos/centrifugal/centrifugo/issues/comments/168029012","html_url":"https://github.com/centrifugal/centrifugo/issues/56#issuecomment-168029012","issue_url":"https://api.github.com/repos/centrifugal/centrifugo/issues/56","id":168029012,"user":{"login":"banks","id":120915,"avatar_url":"https://avatars.githubusercontent.com/u/120915?v=3","gravatar_id":"","url":"https://api.github.com/users/banks","html_url":"https://github.com/banks","followers_url":"https://api.github.com/users/banks/followers","following_url":"https://api.github.com/users/banks/following{/other_user}","gists_url":"https://api.github.com/users/banks/gists{/gist_id}","starred_url":"https://api.github.com/users/banks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/banks/subscriptions","organizations_url":"https://api.github.com/users/banks/orgs","repos_url":"https://api.github.com/users/banks/repos","events_url":"https://api.github.com/users/banks/events{/privacy}","received_events_url":"https://api.github.com/users/banks/received_events","type":"User","site_admin":false},"created_at":"2015-12-30T16:30:43Z","updated_at":"2015-12-30T16:30:43Z","body":"Yeah so this is not as simple as I thought - I assumed disconnect already sent message back to client.\r\n\r\nSo let me re-state what I actually want rather than just suggest we change this existing feature.\r\n\r\nWhat would be useful in some cases would be te ability to put a whole centrifguo cluster into \"load shedding\" mode where they:\r\n - deny incoming requests with a permanent error\r\n - close all existing connections with a `reconnect: false` message\r\n\r\nThe 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.\r\n\r\nOne 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.\r\n\r\nHonestly 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)."}}