-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Fix http.server.close() to properly close idle connections before shu… #53953
base: main
Are you sure you want to change the base?
Conversation
Review requested:
|
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.
Thank you for the contribution. It looks like you've ran a formatter on the file and made a bunch of changes not relevant to what the PR description states. Can you revert those changes and only commit the ones relevant to the issue you are trying to fix?
Furthermore, please add a proper test for this change. Thank you.
Additionally, while recommitting, please choose a commit message that follows the guidelines by remaining under (i think) 80 characters. And prefixed with the Congrats on your contribution :-) |
Thank you for your feedback. I apologize for the unintended formatting changes. I will revert those changes and ensure that only the relevant code is included in the commit. Additionally, I will add a proper test to validate the changes made. I appreciate your guidance and will update the pull request shortly. |
No need to apologize, you're doing great :-)! Welcome to the community. |
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.
The test does not follow the convention in the rest of the codebase. Specifically, it seems it's built on mocha.
Changes:
Added logic to http.server.close() to ensure idle connections are properly closed before the server shuts down.
Included checks for existing connections and closed them gracefully before terminating the server.
Testing:
Verified by running a server and testing that idle connections are closed before the server fully shuts down.