stream: make .destroy() interact better with write queue#24062
Closed
addaleax wants to merge 2 commits intonodejs:masterfrom
Closed
stream: make .destroy() interact better with write queue#24062addaleax wants to merge 2 commits intonodejs:masterfrom
.destroy() interact better with write queue#24062addaleax wants to merge 2 commits intonodejs:masterfrom
Conversation
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.
Member
Author
Member
Author
|
Huh, apparently the test change was only necessary for an earlier version of this patch… interesting. I’m not sure I like this behavior, but on the other hand it means that this is more likely to pass as semver-patch? New CI: https://ci.nodejs.org/job/node-test-pull-request/18319/ (:heavy_check_mark:) |
Member
Author
|
CITGM doesn’t seem to display any results at all…? /cc @nodejs/build-infra |
Member
Author
Member
Author
|
Any other thoughts/reviewers? |
jasnell
approved these changes
Nov 10, 2018
Member
Author
|
Landed in d3f02d0 |
addaleax
added a commit
to addaleax/node
that referenced
this pull request
Nov 10, 2018
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: nodejs#24062 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
BridgeAR
pushed a commit
that referenced
this pull request
Nov 14, 2018
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: #24062 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
kiyomizumia
pushed a commit
to kiyomizumia/node
that referenced
this pull request
Nov 15, 2018
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: nodejs#24062 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This was referenced Nov 15, 2018
codebytere
pushed a commit
that referenced
this pull request
Dec 14, 2018
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: #24062 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins
pushed a commit
that referenced
this pull request
Dec 26, 2018
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: #24062 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Merged
This was referenced Jan 29, 2019
This was referenced Jan 29, 2019
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@nodejs/streams @mcollina @mafintosh I’m mostly looking for feedback on the idea here rather than the implementation, i.e., does this make sense, is this the right behaviour, etc.?
Also, does the test modification here mean that we might have to consider this a breaking change rather than a bugfix?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 callbacksfor writes will now always be called, even when the stream
is destroyed during the process.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes