Queue’s residue (:queue_count) is not 0 after completing all tasks

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)

tasks_with_results = Task.yield_many(tasks, 300_000)

Enum.map(tasks_with_results, fn {task, res} ->
  res || Task.shutdown(task, :brutal_kill)

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.

  "start" => [0, 12],
  "result" => [0, 54],
  "trigger" => [0, 19]

where [0, 54] => [:in_use_count, :queue_count]

Sorry for bad English


I have also found issues with hackney in the past. If you are basing your metrics on the README you may have to delve into code, as the README is not correct regarding metric props.

Consider having a look on the issues list and see if anything pops up that may interest you: