streams: forward errors correctly for duplexPair endpoints#61098
streams: forward errors correctly for duplexPair endpoints#61098aelhor wants to merge 2 commits 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 88.53% 88.53%
========================================
Files 703 704 +1
Lines 208546 209019 +473
Branches 40217 40351 +134
========================================
+ Hits 184634 185061 +427
- Misses 15926 15930 +4
- Partials 7986 8028 +42
🚀 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 |
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
Ensure destroying one side of a duplexPair triggers destruction of the other side via process.nextTick(). To avoid a breaking change and unhandled 'error' events (e.g., in HTTP tests), the error object is not propagated; only the destruction signal is sent.
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 |
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