Skip to content
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

[Merged by Bors] - fix: correct shutdown sequence for http server (ENG-87) #847

Closed

Conversation

DecathectZero
Copy link
Member

@DecathectZero DecathectZero commented Jun 14, 2024

Please read the full report here.

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

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.
Screenshot 2024-06-14 at 7 12 03 PM

Copy link

linear bot commented Jun 14, 2024

Copy link

sonarcloud bot commented Jun 14, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@DecathectZero
Copy link
Member Author

bors r+

bors-vf bot pushed a commit that referenced this pull request Jun 14, 2024
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>
@bors-vf
Copy link

bors-vf bot commented Jun 14, 2024

@bors-vf bors-vf bot changed the title fix: correct shutdown sequence for http server (ENG-87) [Merged by Bors] - fix: correct shutdown sequence for http server (ENG-87) Jun 14, 2024
@bors-vf bors-vf bot closed this Jun 14, 2024
@bors-vf bors-vf bot deleted the tyler/server-shutdown-sequence-fix/ENG-87 branch June 14, 2024 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants