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

wire-api-federation: Disconnect from federator after consuming the response #3663

Merged
merged 2 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/3-bug-fixes/federator-disconnect
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix memory and TCP connection leak in brig, galley, caroghold and background-worker.
3 changes: 2 additions & 1 deletion libs/wire-api-federation/src/Wire/API/Federation/Client.hs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ withNewHttpRequest target req k = do
sendReqMVar <- newEmptyMVar
thread <- liftIO . async $ H2Manager.startPersistentHTTP2Connection ctx target cacheLimit sslRemoveTrailingDot tcpConnectionTimeout sendReqMVar
let newConn = H2Manager.HTTP2Conn thread (putMVar sendReqMVar H2Manager.CloseConnection) sendReqMVar
H2Manager.sendRequestWithConnection newConn req k
H2Manager.sendRequestWithConnection newConn req $ \resp -> do
k resp <* newConn.disconnect

performHTTP2Request ::
Http2Manager ->
Expand Down
Loading