-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Closed
Labels
streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.
Description
Related to #23133.
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:
const rec = 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)
}
)
Metadata
Metadata
Assignees
Labels
streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.