Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: correct shutdown sequence for http server (ENG-87) (#847)
Please read the full report [here](https://www.notion.so/voiceflow/general-runtime-MongoDB-issues-5dcc5295b80a4a39916b6b4a6691cf91). Put simply, we were seeing this Mongo Error: `'MongoNotConnectedError: Client must be connected before running operations` However, it was always occurring AFTER a `SIGTERM` event: ![image](https://github.com/voiceflow/general-runtime/assets/5643574/35c030d4-3738-4134-a72c-f978a8e37282) This is because we were kill all client connections first (Mongo, Redis, etc), THEN we were stopping the server from accepting new connections. What this means is that it was possible for a existing request to be executed, the mongo client to get closed, then for that request to try and make a call to mongo. To reproduce the error locally, just checkout this commit/branch: 18f076c mesh the service and try to make a API call that uses mongo to it within 30 seconds. <img width="1406" alt="Screenshot 2024-06-14 at 7 12 03 PM" src="https://github.com/voiceflow/general-runtime/assets/5643574/9f9ba100-5fc9-4647-89cc-a237ac861529"> Co-authored-by: Tyler <tylerhan97@gmail.com>
- Loading branch information