Skip to content

http: fix event listener leak - #29245

Closed
ronag wants to merge 2 commits into
nodejs:masterfrom
nxtedition:http-fix-listener
Closed

http: fix event listener leak#29245
ronag wants to merge 2 commits into
nodejs:masterfrom
nxtedition:http-fix-listener

Conversation

@ronag

@ronagronag commented Aug 21, 2019

Copy link
Copy Markdown
Member

Alternative to #29244

'drain' needs to always to be removed together with 'data' and 'end' when detaching the socket.

Haven't had time to do a unit test yet.

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

@nodejs-github-botnodejs-github-bot added the http Issues or PRs related to the http subsystem. label Aug 21, 2019
@ronagronag mentioned this pull request Aug 21, 2019
2 tasks
@ronag
ronagforce-pushed the http-fix-listener branch 3 times, most recently from 398333c to 40ff776CompareAugust 21, 2019 13:18
@addaleax

Copy link
Copy Markdown
Member

Do you think you could add a regression test?

@ronag

Copy link
Copy Markdown
MemberAuthor

@addaleax: absolutely, I’ll try to solve that tonight

@ronag

Copy link
Copy Markdown
MemberAuthor

@addaleax: added test

@ronag
ronagforce-pushed the http-fix-listener branch 5 times, most recently from b2d9a28 to 06cceacCompareAugust 21, 2019 17:27
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

Comment threadtest/parallel/test-http-agent-keepalive.js Outdated
Co-Authored-By: Rich Trott <rtrott@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@ronagronag mentioned this pull request Aug 21, 2019
4 tasks
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@TrottTrott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Aug 23, 2019
@Trott

Copy link
Copy Markdown
Member

Note for whoever lands this: Add Fixes: https://github.com/nodejs/node/issues/29239 to the metadata.

@mcollinamcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ronag

ronag commented Aug 23, 2019

Copy link
Copy Markdown
MemberAuthor

I'd like to double check this resolves the warning issue (#29239). However, I'm unsure how to make yarn or npm use the node binary I build? I think @isaacs already checked. But I'd like to know how to do it myself.

@silverwind

Copy link
Copy Markdown
Contributor

I'm unsure how to make yarn or npm use the node binary I build

IIRC, it's just a PATH lookup. Try export PATH="$PWD:$PATH" while in the directory containing node.

@Trott

Copy link
Copy Markdown
Member

I'd like to double check this resolves the warning issue (#29239). However, I'm unsure how to make yarn or npm use the node binary I build? I think @isaacs already checked. But I'd like to know how to do it myself.

I used this:

./node `which npm` install -g node-core-utils

This seems to fix the problem. Without this patch, I get the warnings. With it, I do not.

Trott pushed a commit to Trott/io.js that referenced this pull request Aug 23, 2019
Fixes: nodejs#29239
PR-URL: nodejs#29245
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@Trott

Copy link
Copy Markdown
Member

Landed in f39ad8a

@TrottTrott closed this Aug 23, 2019
@TrottTrott added the notable-change PRs with changes that should be highlighted in changelogs. label Aug 23, 2019
@Trott

Copy link
Copy Markdown
Member

Marked this as notable because we should get this out in a 12.9.1 release and highlight that it fixes the bug in #29239.

targos pushed a commit that referenced this pull request Aug 26, 2019
Fixes: #29239
PR-URL: #29245
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
targos added a commit that referenced this pull request Aug 26, 2019
Notable changes:
This release fixes two regressions in the http module:
* Fixes an event listener leak in the HTTP client. This resulted in lots
of warnings during npm/yarn installs.
#29245
* Fixes a regression preventing the `'end'` event from being emitted for
keepalive requests in case the full body was not parsed.
#29263
PR-URL: #29321
@targostargos mentioned this pull request Aug 26, 2019
targos added a commit that referenced this pull request Aug 26, 2019
Notable changes:
This release fixes two regressions in the http module:
* Fixes an event listener leak in the HTTP client. This resulted in lots
of warnings during npm/yarn installs.
#29245
* Fixes a regression preventing the `'end'` event from being emitted for
keepalive requests in case the full body was not parsed.
#29263
PR-URL: #29321
targos added a commit that referenced this pull request Aug 26, 2019
Notable changes:
This release fixes two regressions in the http module:
* Fixes an event listener leak in the HTTP client. This resulted in lots
of warnings during npm/yarn installs.
#29245
* Fixes a regression preventing the `'end'` event from being emitted for
keepalive requests in case the full body was not parsed.
#29263
PR-URL: #29321
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.httpIssues or PRs related to the http subsystem.notable-changePRs with changes that should be highlighted in changelogs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@ronag@addaleax@nodejs-github-bot@Trott@silverwind@mcollina@jasnell@lpinca@gengjiawen