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
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)})
The text was updated successfully, but these errors were encountered:
ronag
changed the title
pipeline can call callback too early?
pipeline does not wait for full stream destruction
Oct 2, 2018
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.
Related to #23133.
Even if we change so that
open
is emitted beforedestroy
.pipeline
will not wait for completed destruction for all streams. Which can cause subtle bugs with things like:The text was updated successfully, but these errors were encountered: