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
pipeline does not wait for full stream destruction #23214
Even if we change so that open is emitted before destroy. pipeline will not wait for completed destruction for all streams. Which can cause subtle bugs with things like:
constrec=db.getRecord(blockId)pipeline(req,fs.createWriteStream(blockPath,{flags: 'wx'}).on('open',()=>{// Oops, this can be called after rec.destroy() :/. I didn't expect that.rec.set({path: blockPath})}),err=>{rec.destroy()callback(err)})
I'm a bit lost on the difference to #23133. Can you remove the 'open' problem of fs from this issue? This seems a different thing.
What do you mean by "complete destruction of all streams"? .destroy() has currently a private callback. However the .destroy() method in the community does not always have a callback, so how could we wait for something that's not done?
However the .destroy() method in the community does not always have a callback, so how could we wait for something that's not done?
I don't know. All I know is that once the callback on the pipeline is invoked I would expect that no more events are emitted from any of the streams. Which is not how it works right now.
Activity
[-]pipeline can call callback too early?[/-][+]pipeline does not wait for full stream destruction[/+]Fishrock123 commentedon Oct 5, 2018
cc @nodejs/streams
mcollina commentedon Oct 5, 2018
I'm a bit lost on the difference to #23133. Can you remove the
'open'problem offsfrom this issue? This seems a different thing.What do you mean by "complete destruction of all streams"?
.destroy()has currently a private callback. However the.destroy()method in the community does not always have a callback, so how could we wait for something that's not done?ronag commentedon Oct 5, 2018
I don't know. All I know is that once the callback on the pipeline is invoked I would expect that no more events are emitted from any of the streams. Which is not how it works right now.
mcollina commentedon Oct 5, 2018
So it is a duplicate of #23133 and a problem specific to fs.
Also, this would possibly be fixed by #22795.