-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
feat(medusa,medusa-core-utils): graceful shutdown server #3408
Conversation
🦋 Changeset detectedLatest commit: b2b5477 The changes in this PR will be included in the next version bump. This PR includes changesets to release 33 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
@@ -1,4 +1,3 @@ | |||
import e from "express" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self-review: imported by mistake
"@storybook/addon-contexts": "^5.3.21", | ||
"@storybook/addon-essentials": "^6.3.12", | ||
"@storybook/addon-info": "^5.3.21", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self-review: these 2 dependencies are not being used and preventing yarn install
to work on Windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Would be nice to have tests to validate timeout feature and multiple connections handling work as expected.
I've added a few tests covering all these timeouts behavior. Thanks. |
socket._connectionId = connectionId | ||
allSockets[connectionId] = socket | ||
|
||
socket.on("close", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: is the close always called after a end, timeout event as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is. And when it's using keepAlive, it will respect server.keepAliveTimeout to close idle connections with clients.
https://nodejs.org/api/net.html#event-close_1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just have one question 💪
What:
Helper function to gracefully shutdown the http server.
How:
All pending requests are completed before exiting the application.
Fixes: CORE-1142