Hi! I’m using HTTPoison(1.6.1) and Hackney(1.15.2) pools:
:hackney_pool.child_spec(:start, [checkout_timeout: ..., max_connections: 100]),
:hackney_pool.child_spec(:trigger, [checkout_timeout: ..., max_connections: 100]),
:hackney_pool.child_spec(:result, [checkout_timeout: ..., max_connections: 100])
...
HTTPoison.get('...', [...], [
proxy: ...,
proxy_auth: ...,
timeout: ...,
recv_timeout: ...,
hackney: [pool: :start]
])
Which are executed in the tasks:
...
tasks = Enum.map(searches, fn(search) ->
Task.Supervisor.async_nolink(MyApp.TaskSupervisor, fn ->
get_search(pid, search)
end)
end)
tasks_with_results = Task.yield_many(tasks, 300_000)
Enum.map(tasks_with_results, fn {task, res} ->
res || Task.shutdown(task, :brutal_kill)
end)
...
The fact is that I monitor my proxy_stats in real-time with the get_stats/1 function on :hackney_pool
(returns a proplist). So, the issue in that after completing all searches (when ‘queue_count’ > ~900) we get a residue in the ‘queue_count’ when it should be 0.
E.g.:
%{
"start" => [0, 12],
"result" => [0, 54],
"trigger" => [0, 19]
}
where [0, 54] => [:in_use_count, :queue_count]
Sorry for bad English
Thanks