Closed fercasgal closed 7 months ago
When there's a receive timeout, the Mint.HTTP1 simply does:
defp handle_error(conn, error) do conn = put_in(conn.state, :closed) {:error, conn, error, []} end
But the socket is still open and the calling code has no chance of closing it, since: def close(%MODULE{state: :closed} = conn) do {:ok, conn} end
So the calling code believes that it has to open a new connection, and the previous one leaks.
Sorry, I came to post it in the wrong repo. It is good info anyway, so I'll leave here. Here is the link for the corresponding issue in Mint: https://github.com/elixir-mint/mint/issues/415
Thanks for reporting!
When there's a receive timeout, the Mint.HTTP1 simply does:
defp handle_error(conn, error) do conn = put_in(conn.state, :closed) {:error, conn, error, []} end
But the socket is still open and the calling code has no chance of closing it, since: def close(%MODULE{state: :closed} = conn) do {:ok, conn} end
So the calling code believes that it has to open a new connection, and the previous one leaks.