Skip to content

stream: pipeline should use req.abort() to destroy response - #31054

Closed
ronag wants to merge 4 commits into
nodejs:masterfrom
nxtedition:pipeline-response-destroy
Closed

ronag wants to merge 4 commits into
nodejs:masterfrom
nxtedition:pipeline-response-destroy

Conversation

@ronag

@ronag ronag commented Dec 21, 2019 •

Copy link
Copy Markdown
Member

destroy(err) on http response will propagate the error to the
request causing 'error' to be unexpectedly emitted. Furthermore,
response.destroy() unlike request.abort() does not _dump buffered
data.

Fixes a breaking change applied in 6480882.

Prefer res.req.abort() over res.destroy() until this situation is
clarified.

This is a bugfix and I believe it should be semver minor.

Fixes #31029.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. http Issues and PRs related to the http subsystem. stream Issues and PRs related to Node.js streams.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stream.pipeline(httpResponse, decompressStream) emits error three times

9 participants