Uh oh!
There was an error while loading. Please reload this page.
http: don't cork noop .end() - #36633
Conversation
ronag
commented
Dec 26, 2020
@nodejs/http |
ronag
commented
Dec 26, 2020
@kachkaev would you mind confirming whether this resolves your issue? |
mcollina
left a comment
There was a problem hiding this comment.
Could you add a test for the 'drain' event as mentioned in the issue?
Uh oh!
There was an error while loading. Please reload this page.
kachkaev
commented
Dec 26, 2020
@ronag many thanks for the PR! I’m happy to try it out, I just don’t have any experience using custom Node builds. Do you know if it’s possible to do something like this in GitHub workflows? That would be the easiest and show the results transparently to everyone. - name: Use Node.js (custom build)uses: actions/setup-node@v2with:
node-version: ?? from this PR ?? |
ronag
commented
Dec 26, 2020
@kachkaev Sorry, I'm not familiar enough with that. |
mcollina
commented
Dec 26, 2020
Unfortunately no, we don't publish the builds from individual PRs. |
ronag
commented
Dec 26, 2020
The bug is not that the drain event is missing. It's that the socket stays corked and doesn't write. |
mcollina
commented
Dec 26, 2020
Then add a test for the write :). I would like to have a test that checks the end-user behavior. |
benjamingr
left a comment
There was a problem hiding this comment.
LGTM with the test matteo asked for
ronag
commented
Dec 27, 2020
Might need a separate backport for v14. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
mitsos1os
commented
Jan 8, 2021
Hi, is there any progress with PR? |
ronag
commented
Jan 8, 2021
It's missing a test. |
ronag
commented
Jan 9, 2021
If someone wants to help with writing this test I think we could merge this sooner rather than later. |
mitsos1os
commented
Jan 9, 2021
How would you like to help with the test? Could I submit to your repo? |
Just do your own fork, checkout a copy of this branch, and I can pull in your commit. |
mcollina
commented
Jan 10, 2021
Conservatively putting it as semver-major. |
ronag
commented
Jan 11, 2021
@mcollina i disagree with semver major. This is a fix for a rather serious bug. 🤔 |
nodejs-github-bot
commented
Jan 11, 2021
@mcollina I agree with @ronag on that this is a bug in v14 & v15. The behaviour unexpectedly changed between v13 and v14 according to my MWE: https://github.com/kachkaev/node-http-response-double-end-call-breaking-drain-event/runs/1606418629 It took me more than two working days in investigate the problem and create #36633 (it involved quite a few layers of abstraction to shave off). I wish others no longer fall into the same trap after upgrading to Node 14 from v12. Calling |
mcollina
commented
Jan 11, 2021
Agreed, thanks for context. |
Calling .end() a second time should be a noop and not leave the socket corked. Fixes: nodejs#36620
ronag
commented
Jan 12, 2021
Landed in 2af43f6...ec794f9 |
PR-URL: nodejs#36633Fixes: nodejs#36620 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Danielle Adams <adamzdanielle@gmail.com> (cherry picked from commit ec794f9)
mitsos1os
commented
Jan 15, 2021
I have also issued the backport PR for v14 branch here: #36940 |
Calling .end() a second time should be a noop and not
leave the socket corked.
Fixes: #36620
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes