Skip to content

Conversation

@aelhor
Copy link

@aelhor aelhor commented Dec 17, 2025

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

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: nodejs#61015
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/streams

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. stream Issues and PRs related to the stream subsystem. labels Dec 17, 2025
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

@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 18, 2025
@codecov
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.51%. Comparing base (4f24aff) to head (45bc784).
⚠️ Report is 30 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #61098      +/-   ##
==========================================
- Coverage   88.53%   88.51%   -0.02%     
==========================================
  Files         703      703              
  Lines      208546   208559      +13     
  Branches    40217    40224       +7     
==========================================
- Hits       184634   184612      -22     
- Misses      15926    15971      +45     
+ Partials     7986     7976      -10     
Files with missing lines Coverage Δ
lib/internal/streams/duplexpair.js 96.00% <100.00%> (+0.83%) ⬆️

... and 34 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 19, 2025
@nodejs-github-bot
Copy link
Collaborator

@mcollina
Copy link
Member

This is a relevant fail:

---
duration_ms: 114.266
exitcode: 1
severity: fail
stack: "node:events:486\n      throw er; // Unhandled 'error' event\n      ^\n\nError:\
  \ sometimes the code just doesn\u2019t work\n    at DuplexSide.<anonymous> (/home/iojs/build/workspace/node-test-commit-linuxone/test/parallel/test-http-sync-write-error-during-continue.js:46:26)\n\
  \    at DuplexSide._write (/home/iojs/build/workspace/node-test-commit-linuxone/test/common/index.js:506:15)\n\
  \    at doWrite (node:internal/streams/writable:596:12)\n    at clearBuffer (node:internal/streams/writable:781:7)\n\
  \    at Writable.uncork (node:internal/streams/writable:529:7)\n    at ClientRequest.end\
  \ (node:_http_outgoing:1090:19)\n    at ClientRequest.<anonymous> (/home/iojs/build/workspace/node-test-commit-linuxone/test/parallel/test-http-sync-write-error-during-continue.js:49:9)\n\
  \    at ClientRequest.<anonymous> (/home/iojs/build/workspace/node-test-commit-linuxone/test/common/index.js:506:15)\n\
  \    at ClientRequest.emit (node:events:508:20)\n    at HTTPParser.parserOnIncomingClient\
  \ [as onIncoming] (node:_http_client:723:11)\nEmitted 'error' event on DuplexSide\
  \ instance at:\n    at emitErrorNT (node:internal/streams/destroy:170:8)\n    at\
  \ emitErrorCloseNT (node:internal/streams/destroy:129:3)\n    at process.processTicksAndRejections\
  \ (node:internal/process/task_queues:89:21)\n\nNode.js v26.0.0-pre"
...

@Renegade334
Copy link
Member

This would also be semver-major, unless hidden behind an option.

@aelhor
Copy link
Author

aelhor commented Dec 22, 2025

Thanks for flagging this.
I see the failure in test-http-sync-write-error-during-continue.js, and I’ll investigate the regression caused by this change and report back.

@mcollina mcollina added the semver-major PRs that contain breaking changes and should be released in the next major version. label Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. semver-major PRs that contain breaking changes and should be released in the next major version. stream Issues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Errors are not forwarded when using stream.duplexPair()

4 participants