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: make sure end is always emitted with keepalive connections #29263

Closed
wants to merge 2 commits into from

Conversation

@mcollina
Copy link
Member

commented Aug 22, 2019

Unfortunately 779a05d introduced a regression in 12.8.0, making the autocannon test failing on Node 12. This PR reverts 779a05d and adds a test to ensure that we do not regress again.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
mcollina added 2 commits Aug 22, 2019
test, http: add regression test for keepalive 'end' event
This test covers a regression where 'end' was not emitted in the case
of keepalive requests without parsing the full body.

@mcollina mcollina requested review from addaleax and lpinca Aug 22, 2019

@mcollina mcollina requested review from Trott and benjamingr Aug 22, 2019

@mcollina

This comment has been minimized.

Copy link
Member Author

commented Aug 22, 2019

@nodejs-github-bot

This comment has been minimized.

@Trott Trott force-pushed the nodejs:master branch from e460838 to 775048d Aug 22, 2019

@lpinca
lpinca approved these changes Aug 22, 2019
@lpinca

This comment has been minimized.

Copy link
Member

commented Aug 22, 2019

#9668 should be reopened if/when this is merged.

@nodejs-github-bot

This comment has been minimized.

@Trott

This comment has been minimized.

Copy link
Member

commented Aug 24, 2019

Landed in d5c3837...b3172f8

@Trott Trott closed this Aug 24, 2019

Trott added a commit that referenced this pull request Aug 24, 2019
Revert "http: reset parser.incoming when server response is finished"
This reverts commit 779a05d.

PR-URL: #29263
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Trott added a commit that referenced this pull request Aug 24, 2019
test, http: add regression test for keepalive 'end' event
This test covers a regression where 'end' was not emitted in the case
of keepalive requests without parsing the full body.

PR-URL: #29263
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@ronag

This comment has been minimized.

Copy link
Contributor

commented Aug 24, 2019

This is a bit strange to me. In resOnFinish we emit req.'close'. So essentially the "bug" here is that we emit req.'end' when req.'close' has already been emitted. I think we have a different bug here as well in relation to req.'close'. I'll see if I can make a test. EDIT: yep nxtedition#1

@addaleax

This comment has been minimized.

Copy link
Member

commented Aug 24, 2019

@ronag The issue is that in resOnFinish the request might not have ended as a readable stream yet. I’m opening a new PR to fix this properly.

(Aside, if there’s a regression with one of my PRs, feel free to @addaleax me because I’ve configured my inbox to give explicit mentions of my handledhigher priority over other messages.)

addaleax added a commit to addaleax/node that referenced this pull request Aug 24, 2019
http: reset parser.incoming when server request is finished
This resolves a memory leak for keep-alive connections and does not
regress in the way that 779a05d did by waiting for
the incoming request to be finished before releasing the
`parser.incoming` object.

Refs: nodejs#28646
Refs: nodejs#29263
Fixes: nodejs#9668
addaleax added a commit to addaleax/node that referenced this pull request Aug 24, 2019
http: reset parser.incoming when server request is finished
This resolves a memory leak for keep-alive connections and does not
regress in the way that 779a05d did by waiting for
the incoming request to be finished before releasing the
`parser.incoming` object.

Refs: nodejs#28646
Refs: nodejs#29263
Fixes: nodejs#9668
targos added a commit that referenced this pull request Aug 26, 2019
Revert "http: reset parser.incoming when server response is finished"
This reverts commit 779a05d.

PR-URL: #29263
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos added a commit that referenced this pull request Aug 26, 2019
test, http: add regression test for keepalive 'end' event
This test covers a regression where 'end' was not emitted in the case
of keepalive requests without parsing the full body.

PR-URL: #29263
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos added a commit that referenced this pull request Aug 26, 2019
2019-08-26, Version 12.9.1 (Current)
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 targos referenced this pull request Aug 26, 2019

@mcollina mcollina deleted the mcollina:fix-autocannon branch Aug 26, 2019

addaleax added a commit that referenced this pull request Aug 26, 2019
http: reset parser.incoming when server request is finished
This resolves a memory leak for keep-alive connections and does not
regress in the way that 779a05d did by waiting for
the incoming request to be finished before releasing the
`parser.incoming` object.

Refs: #28646
Refs: #29263
Fixes: #9668

PR-URL: #29297
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
targos added a commit that referenced this pull request Aug 26, 2019
http: reset parser.incoming when server request is finished
This resolves a memory leak for keep-alive connections and does not
regress in the way that 779a05d did by waiting for
the incoming request to be finished before releasing the
`parser.incoming` object.

Refs: #28646
Refs: #29263
Fixes: #9668

PR-URL: #29297
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
targos added a commit that referenced this pull request Aug 26, 2019
2019-08-26, Version 12.9.1 (Current)
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
2019-08-26, Version 12.9.1 (Current)
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
JeniaBR added a commit to JeniaBR/node that referenced this pull request Sep 11, 2019
Revert "http: reset parser.incoming when server response is finished"
This reverts commit 779a05d.

PR-URL: nodejs#29263
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
JeniaBR added a commit to JeniaBR/node that referenced this pull request Sep 11, 2019
test, http: add regression test for keepalive 'end' event
This test covers a regression where 'end' was not emitted in the case
of keepalive requests without parsing the full body.

PR-URL: nodejs#29263
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
JeniaBR added a commit to JeniaBR/node that referenced this pull request Sep 11, 2019
http: reset parser.incoming when server request is finished
This resolves a memory leak for keep-alive connections and does not
regress in the way that 779a05d did by waiting for
the incoming request to be finished before releasing the
`parser.incoming` object.

Refs: nodejs#28646
Refs: nodejs#29263
Fixes: nodejs#9668

PR-URL: nodejs#29297
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
JeniaBR added a commit to JeniaBR/node that referenced this pull request Sep 11, 2019
2019-08-26, Version 12.9.1 (Current)
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.
  nodejs#29245
* Fixes a regression preventing the `'end'` event from being emitted for
  keepalive requests in case the full body was not parsed.
  nodejs#29263

PR-URL: nodejs#29321
JeniaBR added a commit to JeniaBR/node that referenced this pull request Sep 11, 2019
Revert "http: reset parser.incoming when server response is finished"
This reverts commit 779a05d.

PR-URL: nodejs#29263
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
JeniaBR added a commit to JeniaBR/node that referenced this pull request Sep 11, 2019
test, http: add regression test for keepalive 'end' event
This test covers a regression where 'end' was not emitted in the case
of keepalive requests without parsing the full body.

PR-URL: nodejs#29263
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
JeniaBR added a commit to JeniaBR/node that referenced this pull request Sep 11, 2019
http: reset parser.incoming when server request is finished
This resolves a memory leak for keep-alive connections and does not
regress in the way that 779a05d did by waiting for
the incoming request to be finished before releasing the
`parser.incoming` object.

Refs: nodejs#28646
Refs: nodejs#29263
Fixes: nodejs#9668

PR-URL: nodejs#29297
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
JeniaBR added a commit to JeniaBR/node that referenced this pull request Sep 11, 2019
2019-08-26, Version 12.9.1 (Current)
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.
  nodejs#29245
* Fixes a regression preventing the `'end'` event from being emitted for
  keepalive requests in case the full body was not parsed.
  nodejs#29263

PR-URL: nodejs#29321
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.