Commit 7eed9d6
fs: fix WriteStream autoClose order
WriteStream autoClose was implemented by manually
calling .destroy() instead of using autoDestroy
and callback. This caused some invariants related
to order of events to be broken.
Fixes: #31776
Backport-PR-URL: #32163
PR-URL: #31790
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>1 parent 897b1d2 commit 7eed9d6
File tree
4 files changed
+31
-26
lines changed- lib/internal/fs
- test/parallel
4 files changed
+31
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
303 | 308 | | |
304 | 309 | | |
305 | 310 | | |
| |||
343 | 348 | | |
344 | 349 | | |
345 | 350 | | |
346 | | - | |
| 351 | + | |
347 | 352 | | |
348 | 353 | | |
349 | 354 | | |
| |||
371 | 376 | | |
372 | 377 | | |
373 | 378 | | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | 379 | | |
379 | 380 | | |
380 | 381 | | |
| |||
425 | 426 | | |
426 | 427 | | |
427 | 428 | | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | 429 | | |
432 | 430 | | |
433 | 431 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | 64 | | |
66 | 65 | | |
67 | 66 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
79 | 70 | | |
80 | 71 | | |
81 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | 30 | | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | 54 | | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
0 commit comments