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

TimeoutError: [Errno 110] Connection timed out #42

Closed codingjoe closed 6 years ago

codingjoe commented 6 years ago
TimeoutError: [Errno 110] Connection timed out
  File "django/core/handlers/exception.py", line 35, in inner
    response = get_response(request)
  File "django/utils/deprecation.py", line 93, in __call__
    response = self.process_request(request)
  File "hirefire/contrib/django/middleware.py", line 65, in process_request
    return self.info(request)
  File "hirefire/contrib/django/middleware.py", line 55, in info
    payload = dump_procs(self.loaded_procs)
  File "hirefire/procs/__init__.py", line 88, in dump_procs
    data = native_dump_procs(procs)
  File "hirefire/procs/__init__.py", line 72, in native_dump_procs
    quantity = proc.quantity(cache=cache)
  File "hirefire/procs/celery.py", line 254, in quantity
    queue = self.channel.queue_declare(queue, passive=True)
  File "amqp/channel.py", line 1145, in queue_declare
    nowait, arguments),
  File "amqp/abstract_channel.py", line 50, in send_method
    conn.frame_writer(1, self.channel_id, sig, args, content)
  File "amqp/method_framing.py", line 166, in write_frame
    write(view[:offset])
  File "amqp/transport.py", line 275, in write
    self._write(s)

The problem is that connection is only been fetched from the pool once the when the middlware and the Procs are loaded. The connection should be fetch on request and properly disposed of after each request.

I am working on a solution.