Repository navigation
Conversation
compose() only listened for 'data' and 'end' on the last stream it was given. When that stream emitted 'error' after its writable side had already finished, pipeline() had already removed its own error listener, so the error reached no listener and was raised as an unhandled 'error' event, crashing the process. Forward tail errors to the composed Duplex by destroying it whenever the tail errors before the composition has been destroyed. Signed-off-by: Matteo Collina <matteo.collina@gmail.com>
Collaborator
|
Review requested:
|
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.
compose() only listened for 'data' and 'end' on the last stream it was
given. When that stream emitted 'error' after its writable side had
already finished, pipeline() had already removed its own error listener,
so the error reached no listener and was raised as an unhandled 'error'
event, crashing the process.
An example is decompressing truncated gzip input through
compose(source, zlib.createGunzip()): the decompressor's final flush
runs after the writable side has finished, so the Z_BUF_ERROR it raises
on truncation is never delivered to the composed Duplex and instead
crashes the process.
Forward tail errors to the composed Duplex by destroying it whenever the
tail errors before the composition has been destroyed. The
for awaitconsumer and a
'error'listener on the composed Duplex both receive theerror, and the request is no longer killed.
cc @nodejs/streams