-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: don't cork noop .end() #36633
http: don't cork noop .end() #36633
Conversation
@nodejs/http |
@kachkaev would you mind confirming whether this resolves your issue? |
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.
Could you add a test for the 'drain' event as mentioned in the issue?
@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@v2
with:
node-version: ?? from this PR ?? |
@kachkaev Sorry, I'm not familiar enough with that. |
Unfortunately no, we don't publish the builds from individual PRs. |
The bug is not that the drain event is missing. It's that the socket stays corked and doesn't write. |
Then add a test for the write :). I would like to have a test that checks the end-user behavior. |
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 with the test matteo asked for
Might need a separate backport for v14. |
Hi, is there any progress with PR? |
It's missing a test. |
If someone wants to help with writing this test I think we could merge this sooner rather than later. |
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. |
Conservatively putting it as semver-major. |
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
@mcollina i disagree with semver major. This is a fix for a rather serious bug. 🤔 |
@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 |
Agreed, thanks for context. |
Calling .end() a second time should be a noop and not leave the socket corked. Fixes: nodejs#36620
Landed in 2af43f6...ec794f9 |
PR-URL: nodejs#36633 Fixes: 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)
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