Commit 163028a
Taras Mankovski
fix(node/stream): handle 'close' event in fromReadable to prevent Windows hang
On Windows, when a child process terminates, its stdio streams may emit
'close' without first emitting 'end'. Since fromReadable only listened
for 'end' to close the signal, the Effection subscription would never
complete. This caused the Win32 exec implementation to hang forever
waiting for stdoutDone/stderrDone resolvers that gate on stream drain.
Adding a 'close' listener ensures the signal closes regardless of
which event the platform emits first. The signal.close() call is
idempotent, so receiving both 'end' and 'close' is safe.1 parent c924aba commit 163028a
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
0 commit comments