Skip to content

Commit 2ea4cc0

Browse files
ronagtargos
authored andcommitted
doc: clarify pipeline stream cleanup
PR-URL: #29738 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent ab060bf commit 2ea4cc0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/api/stream.md

+4
Original file line numberDiff line numberDiff line change
@@ -1587,6 +1587,10 @@ async function run() {
15871587
run().catch(console.error);
15881588
```
15891589

1590+
`stream.pipeline()` will call `stream.destroy(err)` on all streams except:
1591+
* `Readable` streams which have emitted `'end'` or `'close'`.
1592+
* `Writable` streams which have emitted `'finish'` or `'close'`.
1593+
15901594
`stream.pipeline()` leaves dangling event listeners on the streams
15911595
after the `callback` has been invoked. In the case of reuse of streams after
15921596
failure, this can cause event listener leaks and swallowed errors.

0 commit comments

Comments
 (0)