Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v13.x backport] stream: don't destroy final readable stream in pipeline #32111

Closed

Conversation

ronag
Copy link
Member

@ronag ronag commented Mar 5, 2020

If the last stream in a pipeline is still usable/readable
don't destroy it to allow further composition.

Fixes: #32105
Refs: #32110

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

@ronag ronag requested review from mcollina and lpinca and removed request for mcollina March 5, 2020 22:34
@ronag
Copy link
Member Author

ronag commented Mar 5, 2020

Note that the base PR (#32110) has NOT landed yet. I'm just preparing this in order to fast track. I'm not sure what the procedure here is and whether this can land first.

@ronag ronag added the stream Issues and PRs related to the stream subsystem. label Mar 5, 2020
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs nodejs deleted a comment from nodejs-github-bot Mar 5, 2020
@ronag ronag added the fast-track PRs that do not need to wait for 48 hours to land. label Mar 5, 2020
If the last stream in a pipeline is still usable/readable
don't destroy it to allow further composition.

Fixes: nodejs#32105
Backport-PR-URL: nodejs#32111
@nodejs nodejs deleted a comment from nodejs-github-bot Mar 5, 2020
@nodejs-github-bot

This comment has been minimized.

@ronag ronag requested a review from addaleax March 5, 2020 23:25
@ronag
Copy link
Member Author

ronag commented Mar 5, 2020

@szmarczak

@ronag ronag added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 5, 2020
@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@szmarczak szmarczak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@szmarczak
Copy link
Member

There may be an edge case where the source is an IncomingMessage, and in that case the connection will be destroyed after the response has gracefully ended. This will cause to create new connection every time you make a new request. But that should be fixed in

https://github.com/nodejs/node/blob/master/lib/_http_incoming.js#L121-L124

As it should destroy the socket only if the options.agent is set to false or options.createConnection is present.

This PR is good to merge IMO.

@ronag
Copy link
Member Author

ronag commented Mar 6, 2020

FYA: @MylesBorins @codebytere

@ronag
Copy link
Member Author

ronag commented Mar 8, 2020

@nodejs/streams PTAL, this PR (and #32110) needs another approval and should preferably land as soon as possible as it is affecting the ecosystem.

MylesBorins pushed a commit that referenced this pull request Mar 9, 2020
If the last stream in a pipeline is still usable/readable
don't destroy it to allow further composition.

Fixes: #32105
Backport-PR-URL: #32111
PR-URL: #32110
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@MylesBorins
Copy link
Member

landed in 4640ea2

@ronag fwiw backport prs technically don't require any sign off, although it is likely prudent to get someone to look at it. With matteo having signed off I think this is good enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. fast-track PRs that do not need to wait for 48 hours to land. stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants