我正在尝试在Heroku上运行背景芹菜代理,作为Django webapp的一部分。
使用RabbitMQ Bigwig(免费套餐)在Heroku上运行时,系统地每隔3分钟重置以下连接:
2016-11-23T12:31:04.416209+00:00 app[worker.1]: [2016-11-23 12:31:04,415: WARNING/MainProcess] consumer: Connection to broker lost. Trying to re-establish the connection...
2016-11-23T12:31:04.416224+00:00 app[worker.1]: Traceback (most recent call last):
2016-11-23T12:31:04.416225+00:00 app[worker.1]: File "/app/.heroku/python/lib/python2.7/site-packages/celery/worker/consumer.py", line 280, in start
2016-11-23T12:31:04.416227+00:00 app[worker.1]: blueprint.start(self)
2016-11-23T12:31:04.416228+00:00 app[worker.1]: File "/app/.heroku/python/lib/python2.7/site-packages/celery/bootsteps.py", line 123, in start
2016-11-23T12:31:04.416228+00:00 app[worker.1]: step.start(parent)
2016-11-23T12:31:04.416229+00:00 app[worker.1]: File "/app/.heroku/python/lib/python2.7/site-packages/celery/worker/consumer.py", line 884, in start
2016-11-23T12:31:04.416230+00:00 app[worker.1]: c.loop(*c.loop_args())
2016-11-23T12:31:04.416230+00:00 app[worker.1]: File "/app/.heroku/python/lib/python2.7/site-packages/celery/worker/loops.py", line 76, in asynloop
2016-11-23T12:31:04.416232+00:00 app[worker.1]: next(loop)
2016-11-23T12:31:04.416233+00:00 app[worker.1]: File "/app/.heroku/python/lib/python2.7/site-packages/kombu/async/hub.py", line 279, in create_loop
2016-11-23T12:31:04.416234+00:00 app[worker.1]: item()
2016-11-23T12:31:04.416235+00:00 app[worker.1]: File "/app/.heroku/python/lib/python2.7/site-packages/amqp/utils.py", line 42, in __call__
2016-11-23T12:31:04.416236+00:00 app[worker.1]: self.set_error_state(exc)
2016-11-23T12:31:04.416236+00:00 app[worker.1]: File "/app/.heroku/python/lib/python2.7/site-packages/amqp/utils.py", line 39, in __call__
2016-11-23T12:31:04.416238+00:00 app[worker.1]: **dict(self.kwargs, **kwargs) if self.kwargs else kwargs
2016-11-23T12:31:04.416239+00:00 app[worker.1]: File "/app/.heroku/python/lib/python2.7/site-packages/kombu/connection.py", line 288, in drain_events
2016-11-23T12:31:04.416240+00:00 app[worker.1]: return self.transport.drain_events(self.connection, **kwargs)
2016-11-23T12:31:04.416241+00:00 app[worker.1]: File "/app/.heroku/python/lib/python2.7/site-packages/kombu/transport/pyamqp.py", line 95, in drain_events
2016-11-23T12:31:04.416242+00:00 app[worker.1]: return connection.drain_events(**kwargs)
2016-11-23T12:31:04.416242+00:00 app[worker.1]: File "/app/.heroku/python/lib/python2.7/site-packages/amqp/connection.py", line 303, in drain_events
2016-11-23T12:31:04.416243+00:00 app[worker.1]: chanmap, None, timeout=timeout,
2016-11-23T12:31:04.416244+00:00 app[worker.1]: File "/app/.heroku/python/lib/python2.7/site-packages/amqp/connection.py", line 366, in _wait_multiple
2016-11-23T12:31:04.416244+00:00 app[worker.1]: channel, method_sig, args, content = read_timeout(timeout)
2016-11-23T12:31:04.416245+00:00 app[worker.1]: File "/app/.heroku/python/lib/python2.7/site-packages/amqp/connection.py", line 330, in read_timeout
2016-11-23T12:31:04.416245+00:00 app[worker.1]: return self.method_reader.read_method()
2016-11-23T12:31:04.416246+00:00 app[worker.1]: File "/app/.heroku/python/lib/python2.7/site-packages/amqp/method_framing.py", line 189, in read_method
2016-11-23T12:31:04.416247+00:00 app[worker.1]: raise m
2016-11-23T12:31:04.416247+00:00 app[worker.1]: error: [Errno 104] Connection reset by peer
2016-11-23T12:31:04.566069+00:00 app[worker.1]: [2016-11-23 12:31:04,565: INFO/MainProcess] Connected to amqp://my-broker 2016-11-23T12:31:04.611051+00:00 app[worker.1]: [2016-11-23 12:31:04,610: INFO/MainProcess] mingle: searching for neighbors
2016-11-23T12:31:05.714323+00:00 app[worker.1]: [2016-11-23 12:31:05,714: INFO/MainProcess] mingle: all alone
系统地每三分钟强行断开我的经纪人。我正在使用免费的dynos,所以这可能会产生影响。
是否有其他人遇到此问题并可以帮助我阻止此行为?
感谢。
答案 0 :(得分:0)
我通过禁用BROKER_HEARTBEAT修复了它。