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

Fix Request streaming memory leak #665

Merged

Conversation

fabianfett
Copy link
Member

Fixes #663.

Changes

  • We need to drop references to the request body, that we execute in the RequestBag as soon as we can to destroy the reference cycle.
  • To make this easier to read I moved the redirectHandler into the state enum
  • We also don't retain the request in the ResponseAccumulator anymore

@fabianfett fabianfett added the semver/patch For PRs that when merged will only cause a bump of the patch version, ie. 1.0.x -> 1.0.(x+1) label Feb 7, 2023
Copy link
Contributor

@weissi weissi left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

Copy link
Collaborator

@glbrntt glbrntt left a comment

Choose a reason for hiding this comment

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

LGTM

@fabianfett fabianfett merged commit f65f45b into swift-server:main Feb 7, 2023
@fabianfett fabianfett deleted the ff-fix-request-streaming-leak branch February 7, 2023 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/patch For PRs that when merged will only cause a bump of the patch version, ie. 1.0.x -> 1.0.(x+1)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AHC holds onto its body stream writer even after the request is complete
3 participants