(infra): Handle TERM signal for Pod Restarts #6
Ticket(s) / Related Merge Requests
Summary of Changes
This MR handles the SIGTERM
signal and attempts to close the open WebSocket connections gracefully.
The 1012 response code is provided, indicating a service restart. Ideally this will help create smoother Kubernetes deployments.
Testing Considerations
Due to networking issues the application portion of this test can be conducted locally. Simply open a connection with noscl
or another client, and view that the 1012 close code is provided. You can also termindate a pod in K8s and notice that the "Got SIGTERM" log is displayed, indicating that the hook is being called correctly.
NOTE: This is not working in sandbox yet due to issues with the response code not reaching the client. This is likely an issue with either Traefik or the ALB (not sure which yet). Either way, this MR only covers the application portion which can be tested locally.
Deployment Considerations
See the disclaimer above for networking issues.
Regression Scope
This should not affect any existing behavior.
Platform Affected (web, mobile, etc)
Web
Developer Testing Completed
Tested the correct close code is provided locally, currently troubleshooting networking side.
Screenshots / Screen Recording
simplescreenrecorder-2022-08-29_22.34.56.mkv
Does this impact
-
Localization -
Dark/light mode -
Guest mode
Definition of Done Checklist
-
The Acceptance Criteria has been met -
Code is tested: Testing includes unit/spec, E2E/automated and manual testing -
Merge requests description has been filled out