Commit 3fadeba
committed
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: #329551 parent 8a3fa32 commit 3fadeba
File tree
2 files changed
+19
-39
lines changed- lib/internal/streams
- test/parallel
2 files changed
+19
-39
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 28 | + | |
| 29 | + | |
56 | 30 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
61 | 34 | | |
62 | 35 | | |
63 | 36 | | |
64 | 37 | | |
| 38 | + | |
| 39 | + | |
65 | 40 | | |
66 | 41 | | |
67 | 42 | | |
| |||
78 | 53 | | |
79 | 54 | | |
80 | 55 | | |
81 | | - | |
82 | | - | |
| 56 | + | |
| 57 | + | |
83 | 58 | | |
84 | | - | |
| 59 | + | |
85 | 60 | | |
86 | 61 | | |
87 | 62 | | |
88 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
89 | 69 | | |
90 | 70 | | |
91 | 71 | | |
| |||
204 | 184 | | |
205 | 185 | | |
206 | 186 | | |
207 | | - | |
| 187 | + | |
208 | 188 | | |
209 | 189 | | |
210 | 190 | | |
| |||
262 | 242 | | |
263 | 243 | | |
264 | 244 | | |
265 | | - | |
| 245 | + | |
266 | 246 | | |
267 | 247 | | |
268 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
916 | 916 | | |
917 | 917 | | |
918 | 918 | | |
919 | | - | |
| 919 | + | |
920 | 920 | | |
921 | 921 | | |
922 | 922 | | |
| |||
0 commit comments