appsignal / appsignal-elixir

🟪 AppSignal for Elixir package
https://www.appsignal.com/elixir
MIT License
285 stars 82 forks source link

CheckIn.cron drains hackney pool connections #970

Closed ftes closed 3 weeks ago

ftes commented 4 weeks ago

Describe the bug

Calling cron/1 and cron/2 checks out a hackney connection from the pool and doesn't release it again. After a while (roughly 4 hours for a 5-minute-interval cron job) this causes all 50 connections in the default pool to be drained.

To Reproduce

Steps to reproduce the behavior:

> :hackney_pool.get_stats(:default)
[name: :default, max: 50, in_use_count: 0, free_count: 0, queue_count: 0]

> Appsignal.CheckIn.cron("my_check_in")

> Process.sleep(10_000)
> :hackney_pool.get_stats(:default)
[name: :default, max: 50, in_use_count: 1, free_count: 0, queue_count: 0]

> Appsignal.CheckIn.cron("my_check_in", fn -> :ok end)

> Process.sleep(10_000)
> :hackney_pool.get_stats(:default)
[name: :default, max: 50, in_use_count: 2, free_count: 0, queue_count: 0]
unflxw commented 3 weeks ago

Hi @ftes, thank you for reporting this issue! We will look into it and get back to you.

unflxw commented 3 weeks ago

Hi @ftes,

Thank you for reporting this issue, and especially for hinting at the Hackney connection pool! We have now released AppSignal for Elixir 2.13.1, which fixes this issue.