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

Fix http.server.close() to properly close idle connections before shu… #53953

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

shafi-VM
Copy link

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.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/http
  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added http Issues or PRs related to the http subsystem. needs-ci PRs that need a full CI run. labels Jul 19, 2024
Copy link
Contributor

@Ethan-Arrowood Ethan-Arrowood left a 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.

@RedYetiDev
Copy link
Member

Additionally, while recommitting, please choose a commit message that follows the guidelines by remaining under (i think) 80 characters.

And prefixed with the http subsystem.

Congrats on your contribution :-)

@shafi-VM
Copy link
Author

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.

@RedYetiDev
Copy link
Member

I apologize for the unintended formatting changes.

No need to apologize, you're doing great :-)! Welcome to the community.

Copy link
Member

@mcollina mcollina left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http Issues or PRs related to the http subsystem. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants