http: onFinish will not be triggered again when finished#35845
Closed
rickyes wants to merge 5 commits intonodejs:masterfrom
Closed
http: onFinish will not be triggered again when finished#35845rickyes wants to merge 5 commits intonodejs:masterfrom
rickyes wants to merge 5 commits intonodejs:masterfrom
Conversation
Collaborator
|
Review requested:
|
crypt096
approved these changes
Oct 28, 2020
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
|
verified latest pr-commit 6e1c697 fixed regression #35833 in windows (using git-bash): #!/bin/sh
./out/Release/node.exe -e '
require("http").createServer(function (ignore, res) {
res.on("error", function () {
return;
});
res.end("cc");
res.end("dd");
}).listen(8081, function () {
require("http").request("http://localhost:8081").end();
});
setTimeout(process.exit, 5000);
'
# stderr output - none |
This comment has been minimized.
This comment has been minimized.
ronag
reviewed
Oct 28, 2020
This comment has been minimized.
This comment has been minimized.
Contributor
Author
ronag
requested changes
Oct 30, 2020
Member
ronag
left a comment
There was a problem hiding this comment.
Can't this be solved just by putting the if (chunk) branch after the if (this.finished) branch?
Contributor
Author
@ronag Thanks for you comment, that's what I thought at first, but I realized that this would behave differently than the v14 version, with two problems:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Collaborator
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Collaborator
Trott
approved these changes
Nov 12, 2020
Contributor
Commit Queue failed- Loading data for nodejs/node/pull/35845 ✔ Done loading data for nodejs/node/pull/35845 ----------------------------------- PR info ------------------------------------ Title http: onFinish will not be triggered again when finished (#35845) Author Ricky Zhou <0x19951125@gmail.com> (@rickyes) Branch rickyes:fix/http-outgoing-end -> nodejs:master Labels author ready, commit-queue, dont-land-on-v10.x, dont-land-on-v12.x, dont-land-on-v14.x, http Commits 5 - http: OnFinish will not be triggered again when finished - fixup - fixup - fixup! got error event before error callback - fixup! callback order align with stream.Writable Committers 1 - rickyes <0x19951125@gmail.com> PR-URL: https://github.com/nodejs/node/pull/35845 Fixes: https://github.com/nodejs/node/issues/35833 Reviewed-By: Robert Nagy Reviewed-By: Matteo Collina Reviewed-By: Rich Trott ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/35845 Fixes: https://github.com/nodejs/node/issues/35833 Reviewed-By: Robert Nagy Reviewed-By: Matteo Collina Reviewed-By: Rich Trott -------------------------------------------------------------------------------- ✖ Last GitHub CI failed ℹ Last Full PR CI on 2020-11-12T01:40:04Z: https://ci.nodejs.org/job/node-test-pull-request/34349/ - Querying data for job/node-test-pull-request/34349/ ✔ Build data downloaded ✔ Last Jenkins CI successful ℹ This PR was created on Wed, 28 Oct 2020 07:21:43 GMT ✔ Approvals: 3 ✔ - Robert Nagy (@ronag): https://github.com/nodejs/node/pull/35845#pullrequestreview-526035746 ✔ - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/35845#pullrequestreview-525944547 ✔ - Rich Trott (@Trott) (TSC): https://github.com/nodejs/node/pull/35845#pullrequestreview-529123959 -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncu Commit Queue action: https://github.com/nodejs/node/actions/runs/360068464 |
Contributor
Author
|
Landed in e6e64f7 |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the
.end()is called with the payload again after the end, directly return and pass theERR_STREAM_WRITE_AFTER_ENDerror to thecallbackanderrorevent.Fixes: #35833
/cc @ronag @kaizhu256
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes