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

http: don't destroy completed request #33120

Closed
wants to merge 2 commits into from

Conversation

ronag
Copy link
Member

@ronag ronag commented Apr 28, 2020

Calling destroy() on a completed ClientRequest, i.e.
once 'close' will be emitted should be a noop. Also
before emitting 'close' destroyed === true.

Fixes: #32851

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@ronag ronag added the http Issues or PRs related to the http subsystem. label Apr 28, 2020
@ronag ronag force-pushed the http-client-destroy-after-end branch from 1bab1cb to 0111fee Compare April 28, 2020 11:59
@ronag ronag force-pushed the http-client-destroy-after-end branch from 0111fee to 302cb98 Compare April 28, 2020 12:02
@ronag ronag marked this pull request as ready for review April 28, 2020 16:37
@ronag ronag requested a review from mcollina April 28, 2020 16:40
@ronag
Copy link
Member Author

ronag commented Apr 28, 2020

@nodejs/http @nodejs/web-server-frameworks @szmarczak

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.

lgtm.

What's the semver level?

@ronag
Copy link
Member Author

ronag commented Apr 28, 2020

What's the semver level?

I would argue patch. It's kind of a bug fix.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@ronag
Copy link
Member Author

ronag commented Apr 30, 2020

@nodejs/http

@ronag ronag added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 30, 2020
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

Calling destroy() on a completed ClientRequest, i.e.
once 'close' will be emitted should be a noop. Also
before emitting 'close' destroyed === true.

Fixes: nodejs#32851
@ronag ronag force-pushed the http-client-destroy-after-end branch from f0028b4 to 8ff38ec Compare May 9, 2020 09:02
@nodejs-github-bot
Copy link
Collaborator

@ronag
Copy link
Member Author

ronag commented May 9, 2020

@nodejs/http, this needs another review

@ronag ronag requested a review from mcollina May 9, 2020 10:27
ronag added a commit to nxtedition/node that referenced this pull request May 10, 2020
@ronag
Copy link
Member Author

ronag commented May 11, 2020

Landed in b04e884

ronag added a commit that referenced this pull request May 11, 2020
Calling destroy() on a completed ClientRequest, i.e.
once 'close' will be emitted should be a noop. Also
before emitting 'close' destroyed === true.

Fixes: #32851

PR-URL: #33120
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
@ronag ronag closed this May 11, 2020
@benjamingr
Copy link
Member

That's the fastest I've probably ever seen something I review get landed without it being fast-tracked :]

@ronag
Copy link
Member Author

ronag commented May 11, 2020

@benjamingr I was so happy that you reviewed this PR that I just had to land it as quickly as possible to celebrate! 🍾

codebytere pushed a commit that referenced this pull request May 11, 2020
Calling destroy() on a completed ClientRequest, i.e.
once 'close' will be emitted should be a noop. Also
before emitting 'close' destroyed === true.

Fixes: #32851

PR-URL: #33120
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
@codebytere codebytere mentioned this pull request May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. http Issues or PRs related to the http subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

request.abort() still destroys the socket on a successful request
6 participants