Unverified Commit d3f02d0d authored by Anna Henningsen's avatar Anna Henningsen
Browse files

stream: make `.destroy()` interact better with write queue

Make sure that it is safe to call the callback for `_write()`
even in the presence of `.destroy()` calls during that write.

In particular, letting the write queue continue processing would
previously have thrown an exception, because processing writes
after calling `.destroy()` is forbidden.

One test had to be modified to account for the fact that callbacks
for writes will now always be called, even when the stream
is destroyed during the process.

PR-URL: https://github.com/nodejs/node/pull/24062


Reviewed-By: default avatarMatteo Collina <matteo.collina@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
parent fb6c6692
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment