-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
child_processIssues and PRs related to the child_process subsystem.Issues and PRs related to the child_process subsystem.streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.wontfixIssues that will not be fixed.Issues that will not be fixed.
Description
- Version: v9.9.0
- Platform: 4.15.13-1-ARCH deps: update openssl to 1.0.1j #1 SMP PREEMPT Sun Mar 25 11:27:57 UTC 2018 x86_64 GNU/Linux
- Subsystem: stream
I believe commit 9c0c0e68ac introduced a breaking change to what events are emitted from child process streams stdout/stderr.
const { spawn } = require('child_process')
const ps = spawn('ls', ['-al'])
ps.stdout.on('finish', function() {
console.log('Called `finish` on stdout')
});
ps.stdout.on('end', function() {
console.log('Called `end` on stdout')
});
ps.stderr.on('finish', function() {
console.log('Called `finish` on stderr')
});
ps.stderr.on('end', function() {
console.log('Called `end` on stderr')
});
In node v9.9.0
Called `end` on stderr
Called `end` on stdout
In node v9.8.0
Called `end` on stderr
Called `finish` on stderr
Called `end` on stdout
Called `finish` on stdout
Per the documentation, finish
should only be associated with a writable
stream, so the current behavior in 9.9.0 seems to be accurate. Given that, I'm not sure if the previous behavior was a bug or not.
Metadata
Metadata
Assignees
Labels
child_processIssues and PRs related to the child_process subsystem.Issues and PRs related to the child_process subsystem.streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.wontfixIssues that will not be fixed.Issues that will not be fixed.