You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stream.pipeline() does not call the callback on completion #34059
This works as intended. The callback is called in both cases. At least on Node 14.
The stdout example doesn't print anything because pipeline closes stdout before the callback is invoked, hence the console.log (which uses stdout) doesn't do anything. Changing to console.error will properly print as expected.
Activity
jasnell commentedon Jun 26, 2020
@nodejs/streams
ronag commentedon Jun 26, 2020
process.stdout+end()inpipe@vweevers. Maybe related #32373mcollina commentedon Jun 26, 2020
I thought #32373 was supposed to fix this.
ronag commentedon Jun 26, 2020
This works as intended. The callback is called in both cases. At least on Node 14.
The
stdoutexample doesn't print anything because pipeline closesstdoutbefore the callback is invoked, hence theconsole.log(which usesstdout) doesn't do anything. Changing toconsole.errorwill properly print as expected.mcollina commentedon Jun 27, 2020
I think we can close.
matdodgson commentedon Jun 29, 2020
Apologies - should have used better testing code! The problem is fixed in v14 (I assume #32373) so just waiting on the back port to v12.