-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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: add test case for req-res close ordering #36645
Conversation
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.
LGTM if all the added tests pass reliably.
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.
lgtm
37662dd
to
b415015
Compare
Thinking out loud about the tests, I am wondering if this behavior could cause problems. In the first two cases |
I added a few more comments. |
b415015
to
5b2c944
Compare
I still think this behavior is ok. I would like to know a few arguments on why this is bad (minus it was a breaking change as a minor). |
My concern is with framework/libraries that might expect a strict ordering, always. I don't know if that is a good practice or not. This behavior broke |
@cjihrig wdyt? I don't really understand how Hapi relies on this specific ordering of things. |
I did the analysis for hapi and can elaborate. Hapi adds a The specific ordering of the Note that for hapi I tried to change this to listen on the |
Thank you @kanongil for the analysis. It was very helpful. |
@kanongil could you confirm that there is no significant issue with that change shipping in Node.js v16? |
I can't see on https://ci.nodejs.org/ why those 3 jobs are failing, unfortunately. |
Commit Queue failed- Loading data for nodejs/node/pull/36645 ✔ Done loading data for nodejs/node/pull/36645 ----------------------------------- PR info ------------------------------------ Title http: add test case for req-res close ordering (#36645) Author Daniele Belardi (@dnlup) Branch dnlup:fix/regression_test_http_incoming -> nodejs:master Labels author ready, test Commits 1 - http: add test case for req-res close ordering Committers 1 - Daniele Belardi PR-URL: https://github.com/nodejs/node/pull/36645 Reviewed-By: Rich Trott Reviewed-By: Robert Nagy Reviewed-By: Matteo Collina ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/36645 Reviewed-By: Rich Trott Reviewed-By: Robert Nagy Reviewed-By: Matteo Collina -------------------------------------------------------------------------------- ⚠ Commits were pushed since the last review: ⚠ - http: add test case for req-res close ordering ✔ Last GitHub Actions successful ℹ Last Full PR CI on 2021-01-04T21:19:02Z: https://ci.nodejs.org/job/node-test-pull-request/35251/ - Querying data for job/node-test-pull-request/35251/ ✔ Build data downloaded ✔ Last Jenkins CI successful ℹ This PR was created on Sun, 27 Dec 2020 18:06:44 GMT ✔ Approvals: 3 ✔ - Rich Trott (@Trott) (TSC): https://github.com/nodejs/node/pull/36645#pullrequestreview-558953069 ✔ - Robert Nagy (@ronag): https://github.com/nodejs/node/pull/36645#pullrequestreview-558953108 ✔ - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/36645#pullrequestreview-558962536 -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/463731724 |
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.
lgtm
Since 55e83cb has changed the ordering of the close event, add a test case. IncomingMessage will emit close before the response is sent in case the server is consuming data from it. Refs: nodejs#33035 (comment) PR-URL: nodejs#36645 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
5b2c944
to
ddac3bd
Compare
Landed in ddac3bd |
Since 55e83cb has changed the ordering of the close event, add a test case. IncomingMessage will emit close before the response is sent in case the server is consuming data from it. Refs: #33035 (comment) PR-URL: #36645 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Since the PR #33035 has changed the ordering of the close event, add a test case.
IncomingMessage will emit close before the response is sent in case the server is consuming data from it.
See comment #33035 (comment)
As @kanongil pointed out,
IncomingMessage
is emitting close before the response when the server attaches a handler to the requestdata
event. Otherwise, the order is the same as it was before the change in the linked PR.The test should catch eventual regressions, but let's also use this as a point for discussing this behavior further, if needed.
@ronag @mcollina
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes