Closed PMAxelDelsol closed 8 months ago
Are you closing the connection?
begin
response = client.get('/delay/1')
response.read
ensure
response.close
end
Are you closing the proxy client?
Async do
proxy_endpoint = Async::HTTP::Endpoint.parse(proxy_url)
proxy_client = Async::HTTP::Client.new(proxy_endpoint)
endpoint = Async::HTTP::Endpoint.parse(endpoint_url)
client = proxy_client.proxied_client(endpoint)
# use client
ensure
client.close
proxy_client.close
end
I'll try out your code to see if I can reproduce the issue.
Closing the client and the proxy_client (in that order) now waits for the pool to drain and then exit properly.
Thanks for your help !
When trying to use async-http client with a proxy, closing the client hangs indefinitely. Below is a simplified example to reproduce the issue.
Sample run using CONSOLE_LEVEL=debug:
The issue looks like #37 so I tried to add
response.read
. Now it ends with a warning: