Skip to content

Commit

Permalink
wire-api-federation: Disconnect from federator after consuming the re…
Browse files Browse the repository at this point in the history
…sponse (#3663)
  • Loading branch information
akshaymankar committed Oct 19, 2023
1 parent 4328659 commit 3aaa9f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
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

0 comments on commit 3aaa9f8

Please sign in to comment.