Skip to content
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

Merged
merged 2 commits into from
Oct 28, 2024

Conversation

ronag
Copy link
Member

@ronag ronag commented Oct 19, 2024

Enforce stream invariant. No new errors can occur after .destroy(err)

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Oct 19, 2024

Review requested:

  • @nodejs/http
  • @nodejs/net

@ronag

This comment was marked as resolved.

@nodejs-github-bot nodejs-github-bot added http Issues or PRs related to the http subsystem. needs-ci PRs that need a full CI run. labels Oct 19, 2024
@ronag ronag force-pushed the no-error-after-destroy branch from 1dc7aba to 1fad5a9 Compare October 19, 2024 09:30
@ronag ronag force-pushed the no-error-after-destroy branch from 1fad5a9 to 67f5de3 Compare October 19, 2024 14:42
@ronag ronag marked this pull request as ready for review October 19, 2024 14:42
@ronag ronag requested review from mcollina and lpinca October 19, 2024 14:42
@ronag ronag added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 19, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 19, 2024
@nodejs-github-bot
Copy link
Collaborator

Copy link

codecov bot commented Oct 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.39%. Comparing base (d881fcb) to head (ddcfee7).
Report is 108 commits behind head on main.

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     
Files with missing lines Coverage Δ
lib/_http_outgoing.js 94.99% <100.00%> (-0.07%) ⬇️

... and 132 files with indirect coverage changes

@mcollina mcollina added the baking-for-lts PRs that need to wait before landing in a LTS release. label Oct 19, 2024
Copy link
Member

@mcollina mcollina left a 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).

test/parallel/test-http-outgoing-destroyed.js Outdated Show resolved Hide resolved
@ronag ronag added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 19, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 19, 2024
@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Oct 19, 2024

Copy link
Contributor

@Ethan-Arrowood Ethan-Arrowood left a 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?

Copy link
Member

@jasnell jasnell left a 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.

@avivkeller avivkeller added the needs-citgm PRs that need a CITGM CI run. label Oct 20, 2024
@ronag
Copy link
Member Author

ronag commented Oct 21, 2024

I think it would good to have this fixed on LTS... It crashed and burned us in production.

@ronag
Copy link
Member Author

ronag commented Oct 21, 2024

I don't remember how to start CITGM. Anyone care to help?

@ronag ronag added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Oct 21, 2024
@lpinca
Copy link
Member

lpinca commented Oct 21, 2024

@ronag
Copy link
Member Author

ronag commented Oct 25, 2024

Less failures than main so I guess this can land?

@ronag ronag added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 25, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 25, 2024
@nodejs-github-bot
Copy link
Collaborator

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 destroy

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]>

[detached HEAD 91ad305189] 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(-)
Rebasing (3/4)
Rebasing (4/4)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
Update test-http-outgoing-destroyed.js

Co-authored-by: Luigi Pinca <[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]>

[detached HEAD 0f2e9b3c39] 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(-)
Successfully rebased and updated refs/heads/main.

ℹ Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/11515733656

@nodejs-github-bot nodejs-github-bot added the commit-queue-failed An error occurred while landing this pull request using GitHub Actions. label Oct 25, 2024
@ronag ronag added commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Oct 25, 2024
@ronag ronag added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 28, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 28, 2024
@nodejs-github-bot nodejs-github-bot merged commit 5633c62 into nodejs:main Oct 28, 2024
79 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 5633c62

Ceres6 pushed a commit to Ceres6/node that referenced this pull request Oct 30, 2024
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]>
RafaelGSS pushed a commit that referenced this pull request Nov 1, 2024
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]>
louwers pushed a commit to louwers/node that referenced this pull request Nov 2, 2024
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;
Copy link

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?

tpoisseau pushed a commit to tpoisseau/node that referenced this pull request Nov 21, 2024
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]>
aduh95 pushed a commit to aduh95/node that referenced this pull request Dec 4, 2024
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]>
aduh95 pushed a commit that referenced this pull request Dec 10, 2024
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. baking-for-lts PRs that need to wait before landing in a LTS release. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. http Issues or PRs related to the http subsystem. needs-ci PRs that need a full CI run. needs-citgm PRs that need a CITGM CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants