ryanhiebert / hirefire

A Python lib to integrate with the HireFire service -- The Heroku Proccess Manager.
https://hirefire.readthedocs.io/
Other
34 stars 21 forks source link

CeleryProc creates a lot of idle channels #51

Closed alex-verve closed 5 years ago

alex-verve commented 5 years ago

Reasoning

After installing hirefire middleware + CeleryProc we noticed that number of channels started growing linearly. image

It looks like hirefire.procs.celery.CeleryProc creates a lot of new channels and leaves them opened because connection.channel() creates new channel on every call.

What has changed?

How to test it and expected results?

Before: image

After: image

ryanhiebert commented 5 years ago

Thank you! We've been seeing this behavior as well, but I hadn't been able to track it down yet, or even confirm it was from this library. I'll look at this PR more tomorrow, but at a glance it looks good to me. I haven't looked at the build failure yet.

codecov[bot] commented 5 years ago

Codecov Report

Merging #51 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #51   +/-   ##
=======================================
  Coverage   54.63%   54.63%           
=======================================
  Files          11       11           
  Lines         410      410           
=======================================
  Hits          224      224           
  Misses        186      186
Impacted Files Coverage Δ
hirefire/procs/celery.py 80.41% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4587206...34aa31c. Read the comment docs.