stream: pipeline should only destroy un-finished streams · nodejs/node@180b935 · GitHub
Skip to content

Commit 180b935

Browse files
ronagBethGriggs
authored andcommitted
stream: pipeline should only destroy un-finished streams
This PR logically reverts #31940 which has caused lots of unnecessary breakage in the ecosystem. This PR also aligns better with the actual documented behavior: `stream.pipeline()` will call `stream.destroy(err)` on all streams except: * `Readable` streams which have emitted `'end'` or `'close'`. * `Writable` streams which have emitted `'finish'` or `'close'`. The behavior introduced in #31940 was much more aggressive in terms of destroying streams. This was good for avoiding potential resources leaks however breaks some common assumputions in legacy streams. Furthermore, it makes the code simpler and removes some hacks. Fixes: #32954 Fixes: #32955 PR-URL: #32968 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Mathias Buus <mathiasbuus@gmail.com>
1 parent bbed1e5 commit 180b935

2 files changed

Lines changed: 112 additions & 39 deletions

File tree

lib/internal/streams/pipeline.js

Lines changed: 18 additions & 38 deletions

test/parallel/test-stream-pipeline.js

Lines changed: 94 additions & 1 deletion

0 commit comments

Comments
 (0)