Restart Action Cable server when Redis disconnects
What does this MR do and why?
Prevent Puma from crashing when there are connection errors to Redis. This change catches the error and restarts the Action Cable server when there are connection errors.
We need to restart Action Cable and disconnect all clients because once we reconnect to Redis, all the previous SUBSCRIBE commands we made are no longer applicable.
How to set up and validate locally
- Change
cable.yml
so that it connects to a different Redis server - Start Puma and open an issue page (e.g. http://localhost:3000/group/project/-/issues/1). This is the only page right now that uses Action Cable.
- Stop / restart the Redis server
Without this change, Puma workers would crash. With this MR, it will just disconnect the Action Cable clients and then reconnect until Redis is up again. You will be able to continue to browse the web UI.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #352250 (closed)
Edited by Heinrich Lee Yu