<!-- Thank you for reporting an issue. This issue tracker is for bugs and issues found within Node.js core. If you require more general support please file an issue on our help repo. https://github.com/nodejs/help Please fill in as much of the template below as you're able. Version: output of `node -v` Platform: output of `uname -a` (UNIX), or output of `"$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" })"` in PowerShell console (Windows) Subsystem: if known, please specify affected core module name --> * **Version**: master * **Platform**: Linux 5.4.0-70-generic #78-Ubuntu SMP Fri Mar 19 13:29:52 UTC 2021 x86_64 x86_64 x86_64 GNU/Linuxd * **Subsystem**: child_process ### What steps will reproduce the bug? ```js const child_process = require('child_process'); const proc = child_process.spawn('bash', ['-c', 'exec 0>&- 1>&- 2>&-; sleep 5'], { stdio: ['inherit', 'pipe', 'inherit'] }); proc.stdout.pipe(process.stdout); proc.on('exit', () => console.log('exit')); proc.on('close', () => console.log('close')); ``` ### How often does it reproduce? Is there a required condition? Always ### What is the expected behavior? 'close' should be emitted immediately (all stdio streams are closed), 'exit' after 5 seconds ### What do you see instead? 5 seconds pass, then 'exit' is emitted and then 'closed'
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior?
'close' should be emitted immediately (all stdio streams are closed), 'exit' after 5 seconds
What do you see instead?
5 seconds pass, then 'exit' is emitted and then 'closed'