streams: forward errors correctly for duplexPair endpoints#61098
streams: forward errors correctly for duplexPair endpoints#61098Renegade334 merged 1 commit intonodejs:mainfrom
Conversation
|
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #61098 +/- ##
==========================================
- Coverage 89.68% 89.67% -0.02%
==========================================
Files 676 676
Lines 206451 206475 +24
Branches 39523 39531 +8
==========================================
- Hits 185161 185156 -5
- Misses 13432 13455 +23
- Partials 7858 7864 +6
🚀 New features to boost your workflow:
|
|
This is a relevant fail: |
|
This would also be semver-major, unless hidden behind an option. |
|
Thanks for flagging this. |
|
I have added a new commit that addresses the review comments and fixes the regression in test-http-sync-write-error-during-continue.js. I used process.nextTick to ensure destruction happens after the current execution stack, and I am only propagating the destruction signal (not the error object) to avoid breaking existing code that lacks error listeners on both sides of the pair. All tests and lints now pass locally. |
|
Hi @lpinca @mcollina @Renegade334 👋 |
|
Can you fix the commit messagec |
61f1443 to
3c1376e
Compare
|
@mcollina |
This comment has been minimized.
This comment has been minimized.
|
I have reviewed the CI logs for the current failures:
These appear to be unrelated flaky tests. My new test (test-stream-duplexpair-destroy.js) and the regression test (test-http-sync-write-error-during-continue.js) passed successfully across all platforms. Is it possible to get a re-ci to confirm a clean pass? |
|
CI is now green after the latest fix. Since this addresses the previous failure, would it make sense to re-evaluate the semver-major label to see if it’s still applicable? |
|
If this no longer triggers errors on the other side then it should be semver-minor. It'd be helpful if you squashed down your commits so that |
3c1376e to
e57d5bb
Compare
Ensure destroying one side of a duplexPair triggers destruction of the other side via process.nextTick(). Only the destruction signal is sent to avoid breaking changes. Fixes: nodejs#61015
|
This failure appears to be a flake in test-debugger-exceptions (OSX) and a potential timeout on Windows ARM64, as the code remains unchanged from the previous green CI run. Can we trigger a re-run to confirm? |
|
I've retrigged CI and all passed, reran the failed GHA as well. |
Commit Queue failed- Loading data for nodejs/node/pull/61098
✔ Done loading data for nodejs/node/pull/61098
----------------------------------- PR info ------------------------------------
Title streams: forward errors correctly for duplexPair endpoints (#61098)
⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch aelhor:streams/fix-duplexpair -> nodejs:main
Labels stream, semver-minor, needs-ci
Commits 1
- stream: propagate destruction in duplexPair
Committers 1
- Ahmed Elhor <aelhor90@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/61098
Fixes: https://github.com/nodejs/node/issues/61015
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/61098
Fixes: https://github.com/nodejs/node/issues/61015
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
--------------------------------------------------------------------------------
ℹ This PR was created on Wed, 17 Dec 2025 17:25:57 GMT
✔ Approvals: 3
✔ - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/61098#pullrequestreview-3800111566
✔ - Gürgün Dayıoğlu (@gurgunday): https://github.com/nodejs/node/pull/61098#pullrequestreview-3805285530
✔ - René (@Renegade334): https://github.com/nodejs/node/pull/61098#pullrequestreview-3933061949
✘ 21 GitHub CI job(s) cancelled:
✘ - coverage-windows: CANCELLED (https://github.com/nodejs/node/actions/runs/22977778707/job/66711491167)
✘ - test-linux (ubuntu-24.04): CANCELLED (https://github.com/nodejs/node/actions/runs/22977778708/job/66711491363)
✘ - test-linux (ubuntu-24.04-arm): CANCELLED (https://github.com/nodejs/node/actions/runs/22977778708/job/66711491425)
✘ - lint-js-and-md: CANCELLED (https://github.com/nodejs/node/actions/runs/22977778723/job/66711492465)
✘ - lint-cpp: CANCELLED (https://github.com/nodejs/node/actions/runs/22977778723/job/66711492466)
✘ - lint-codeowners: CANCELLED (https://github.com/nodejs/node/actions/runs/22977778723/job/66711492469)
✘ - lint-nix: CANCELLED (https://github.com/nodejs/node/actions/runs/22977778723/job/66711492474)
✘ - lint-readme: CANCELLED (https://github.com/nodejs/node/actions/runs/22977778723/job/66711492475)
✘ - lint-yaml: CANCELLED (https://github.com/nodejs/node/actions/runs/22977778723/job/66711492476)
✘ - lint-pr-url: CANCELLED (https://github.com/nodejs/node/actions/runs/22977778723/job/66711492477)
✘ - lint-py: CANCELLED (https://github.com/nodejs/node/actions/runs/22977778723/job/66711492478)
✘ - format-cpp: CANCELLED (https://github.com/nodejs/node/actions/runs/22977778723/job/66711492480)
✘ - lint-sh: CANCELLED (https://github.com/nodejs/node/actions/runs/22977778723/job/66711492496)
✘ - lint-addon-docs: CANCELLED (https://github.com/nodejs/node/actions/runs/22977778723/job/66711492502)
✘ - coverage-linux: CANCELLED (https://github.com/nodejs/node/actions/runs/22977778719/job/66711491665)
✘ - coverage-linux-without-intl: CANCELLED (https://github.com/nodejs/node/actions/runs/22977778724/job/66711492826)
✘ - build-tarball: CANCELLED (https://github.com/nodejs/node/actions/runs/22977778725/job/66711491865)
✘ - test-tarball-linux: CANCELLED (https://github.com/nodejs/node/actions/runs/22977778725/job/66711495004)
✘ - build-docs: CANCELLED (https://github.com/nodejs/node/actions/runs/22977778738/job/66711494836)
✘ - Build slim tarball: CANCELLED (https://github.com/nodejs/node/actions/runs/22977778739/job/66711493504)
✘ - ${{ matrix.system }}: with shared libraries: CANCELLED (https://github.com/nodejs/node/actions/runs/22977778739/job/66711497168)
ℹ Last Full PR CI on 2026-04-07T08:52:08Z: https://ci.nodejs.org/job/node-test-pull-request/72529/
- Querying data for job/node-test-pull-request/72529/
✔ Build data downloaded
✔ Last Jenkins CI successful
--------------------------------------------------------------------------------
✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/24095491560 |
|
Landed in 68e5f87 |
fix the duplexPair implementation so that when one side is destroyed with an error, the other side also receives the error or a close event as appropriate.
previous behavior caused sideA to never emit an 'error' or 'close' when sideB errored, which prevented users from observing or handling the paired stream failure.
Fixes: #61015