-
Notifications
You must be signed in to change notification settings - Fork 30k
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 emit error after destroy #55457
http: don't emit error after destroy #55457
Conversation
Review requested:
|
This comment was marked as resolved.
This comment was marked as resolved.
1dc7aba
to
1fad5a9
Compare
1fad5a9
to
67f5de3
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #55457 +/- ##
==========================================
- Coverage 88.40% 88.39% -0.01%
==========================================
Files 652 653 +1
Lines 186777 187489 +712
Branches 36047 36095 +48
==========================================
+ Hits 165111 165740 +629
- Misses 14919 14980 +61
- Partials 6747 6769 +22
|
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 green CI. Also a CITGM run would be useful.
(We might consider shipping this as a major).
Co-authored-by: Luigi Pinca <[email protected]>
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.
I think this is semver major, right?
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.
I think technically this likely qualifies as a bug fix but I do worry about it being potentially breaking / semver-major.
I think it would good to have this fixed on LTS... It crashed and burned us in production. |
I don't remember how to start CITGM. Anyone care to help? |
Less failures than main so I guess this can land? |
Commit Queue failed- Loading data for nodejs/node/pull/55457 ✔ Done loading data for nodejs/node/pull/55457 ----------------------------------- PR info ------------------------------------ Title http: don't emit error after destroy (#55457) Author Robert Nagy <[email protected]> (@ronag) Branch ronag:no-error-after-destroy -> nodejs:main Labels http, baking-for-lts, author ready, needs-ci, needs-citgm Commits 2 - http: don't emit error after destroy - Update test-http-outgoing-destroyed.js Committers 2 - Robert Nagy <[email protected]> - GitHub <[email protected]> PR-URL: https://github.com/nodejs/node/pull/55457 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]> Reviewed-By: James M Snell <[email protected]> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/55457 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]> Reviewed-By: James M Snell <[email protected]> -------------------------------------------------------------------------------- ℹ This PR was created on Sat, 19 Oct 2024 09:16:44 GMT ✔ Approvals: 5 ✔ - Yagiz Nizipli (@anonrig) (TSC): https://github.com/nodejs/node/pull/55457#pullrequestreview-2379567206 ✔ - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/55457#pullrequestreview-2379652399 ✔ - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/55457#pullrequestreview-2379661418 ✔ - Ethan Arrowood (@Ethan-Arrowood): https://github.com/nodejs/node/pull/55457#pullrequestreview-2379742837 ✔ - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/55457#pullrequestreview-2380690848 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2024-10-19T19:28:30Z: https://ci.nodejs.org/job/node-test-pull-request/63203/ ℹ Last CITGM CI on 2024-10-21T05:34:31Z: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/3492/ - Querying data for job/node-test-pull-request/3492/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/main up to date... From https://github.com/nodejs/node * branch main -> FETCH_HEAD ✔ origin/main is now up-to-date - Downloading patch for 55457 From https://github.com/nodejs/node * branch refs/pull/55457/merge -> FETCH_HEAD ✔ Fetched commits as 7ddd2c228296..ddcfee78255b -------------------------------------------------------------------------------- [main b05441fc9e] http: don't emit error after destroy Author: Robert Nagy <[email protected]> Date: Sat Oct 19 11:16:00 2024 +0200 2 files changed, 27 insertions(+), 1 deletion(-) [main 328ad3e913] Update test-http-outgoing-destroyed.js Author: Robert Nagy <[email protected]> Date: Sat Oct 19 20:33:05 2024 +0200 1 file changed, 1 insertion(+), 1 deletion(-) ✔ Patches applied There are 2 commits in the PR. Attempting autorebase. Rebasing (2/4) Executing: git node land --amend --yes --------------------------------- New Message ---------------------------------- http: don't emit error after destroyhttps://github.com/nodejs/node/actions/runs/11515733656 |
Landed in 5633c62 |
PR-URL: nodejs#55457 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jake Yuesong Li <[email protected]>
PR-URL: #55457 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jake Yuesong Li <[email protected]>
PR-URL: nodejs#55457 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jake Yuesong Li <[email protected]>
@@ -908,6 +908,10 @@ OutgoingMessage.prototype.write = function write(chunk, encoding, callback) { | |||
}; | |||
|
|||
function onError(msg, err, callback) { | |||
if (msg.destroyed) { | |||
return; |
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.
Does this mean that if I call end(chunk, CB)
and this
is both finished
and destroyed
, the callback won't be called?
PR-URL: nodejs#55457 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jake Yuesong Li <[email protected]>
PR-URL: nodejs#55457 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jake Yuesong Li <[email protected]>
PR-URL: #55457 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jake Yuesong Li <[email protected]>
Enforce stream invariant. No new errors can occur after
.destroy(err)