-
Notifications
You must be signed in to change notification settings - Fork 194
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
http-conduit: Request
s may be retained in Response
s
#538
Comments
This was referenced Jul 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A colleague (@kokobd) did a lot of digging into space leaks while using amazonka, and we've observed that large requests cause a noticeable space leak. This sounds similar to brendanhay/amazonka#475
When
http-conduit
constructs a response, it stores the original request in a record field and overwrites its body:http-client/http-client/Network/HTTP/Client/Response.hs
Line 164 in 6f742e8
We suspect that this record update is never forced (there are no bang-patterns or other strictness tools that we can see), so the original request body cannot be garbage collected until execution leaves the
ResourceT
.It might be necessary to add bang patterns to (at least) the
responseOriginalRequest
field ofResponse
and therequestBody
field ofRequest
. It is probably safe for the fields of theRequestBody
constructors to remain lazy.The text was updated successfully, but these errors were encountered: