sneako / finch

Elixir HTTP client, focused on performance
MIT License
1.23k stars 114 forks source link

Mint.HTTP1 leaks socket upon receive timeout #254

Closed fercasgal closed 7 months ago

fercasgal commented 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.

fercasgal commented 7 months ago

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

sneako commented 7 months ago

Thanks for reporting!