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: regression in v14, this.push(null) in Transform doesn't emit end #35926
In this case... shouldn't it actually fail with ERR_STREAM_WRITE_AFTER_END since pipe will continue writing?
Problem is data not processed in consumer at all. Handlers, which have to call end/destroy are not reached. Looks like data buffered somewhere until stream end.
I think we'd need to bisect this if you do not have a suspect.
Haven't started digging yet. Trying to understand how it should work first.
No. .pipe() historically automatically unpiped from the source if the destination ended, i.e. the source is not paused while it should be.
I'm not sure i entirely agree with this. .pipe() will unpipe on 'end', however 'end' is emitted sometime after the destination has been .end():ed so there is still a possibility (which is quite probable) that pipe will call .write() after .end() but before 'end'.
I suspect we would need to update .pipe() to check for writableEnded before .write() to correctly achieve the behavior you are assuming.
Activity
lpinca commentedon Nov 2, 2020
@nodejs/streams @ronag
mcollina commentedon Nov 2, 2020
Confirmed, this is a bug, just tested in the latest v14 and on master.
ronag commentedon Nov 2, 2020
In this case... shouldn't it actually fail with
ERR_STREAM_WRITE_AFTER_ENDsincepipewill continue writing?If find this case quite problematic.
puzrin commentedon Nov 3, 2020
Problem is data not processed in consumer at all. Handlers, which have to call end/destroy are not reached. Looks like data buffered somewhere until stream end.
https://github.com/nodeca/probe-image-size/blob/master/stream.js - full source if anyone interested.
The same with generator-based source:
mcollina commentedon Nov 3, 2020
No.
.pipe()historically automatically unpiped from the source if the destination ended, i.e. the source is not paused while it should be.I think we'd need to bisect this if you do not have a suspect.
ronag commentedon Nov 3, 2020
Haven't started digging yet. Trying to understand how it should work first.
I'm not sure i entirely agree with this.
.pipe()will unpipe on'end', however'end'is emitted sometime after the destination has been.end():ed so there is still a possibility (which is quite probable) that pipe will call.write()after.end()but before'end'.I suspect we would need to update
.pipe()to check forwritableEndedbefore.write()to correctly achieve the behavior you are assuming.mcollina commentedon Nov 3, 2020
let's get the fix in and then do a follow-up refactor.
stream: fix regression on duplex end
stream: fix regression on duplex end
stream: fix regression on duplex end
stream: fix regression on duplex end
stream: fix regression on duplex end
stream: fix regression on duplex end
stream: fix regression on duplex end