Uh oh!
There was an error while loading. Please reload this page.
http: add test case for req-res close ordering - #36645
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Trott
left a comment
There was a problem hiding this comment.
LGTM if all the added tests pass reliably.
nodejs-github-bot
commented
Dec 27, 2020
37662dd to
b415015Comparednlup
commented
Dec 28, 2020
Thinking out loud about the tests, I am wondering if this behavior could cause problems. In the first two cases |
dnlup
commented
Dec 28, 2020
I added a few more comments. |
b415015 to
5b2c944Comparemcollina
commented
Dec 28, 2020
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). |
dnlup
commented
Dec 28, 2020
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 |
mcollina
commented
Dec 28, 2020
@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 |
dnlup
commented
Dec 28, 2020
Thank you @kanongil for the analysis. It was very helpful. |
mcollina
commented
Dec 28, 2020
@kanongil could you confirm that there is no significant issue with that change shipping in Node.js v16? |
nodejs-github-bot
commented
Jan 3, 2021
dnlup
commented
Jan 4, 2021
I can't see on https://ci.nodejs.org/ why those 3 jobs are failing, unfortunately. |
nodejs-github-bot
commented
Jan 4, 2021
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 |
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
ddac3bdCompareaduh95
commented
Jan 6, 2021
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,
IncomingMessageis emitting close before the response when the server attaches a handler to the requestdataevent. 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