我正在使用Flask和远程celery worker,为了进行celery通信,我正在使用rabbitmq作为消息代理。远程celery worker会随机抛出以下错误:
[2020-09-03 13:49:59,390: CRITICAL/MainProcess] Couldn't ack 20, reason:RecoverableConnectionError(None, 'connection already closed', None, '')
Traceback (most recent call last):
File "c:\users\g-us01.test\.virtualenvs\celery_doors_integration-o4w-mxzx\lib\site-packages\kombu\message.py", line 131, in ack_log_error
self.ack(multiple=multiple)
File "c:\users\g-us01.test\.virtualenvs\celery_doors_integration-o4w-mxzx\lib\site-packages\kombu\message.py", line 126, in ack
self.channel.basic_ack(self.delivery_tag, multiple=multiple)
File "c:\users\g-us01.test\.virtualenvs\celery_doors_integration-o4w-mxzx\lib\site-packages\amqp\channel.py", line 1394, in basic_ack
spec.Basic.Ack, argsig, (delivery_tag, multiple),
File "c:\users\g-us01.test\.virtualenvs\celery_doors_integration-o4w-mxzx\lib\site-packages\amqp\abstract_channel.py", line 56, in send_method
raise RecoverableConnectionError('connection already closed')
amqp.exceptions.RecoverableConnectionError: connection already closed
我正在使用celery 4版本。 有什么方法可以避免这个错误吗?
celery_app = Celery(backend='<backend'>, broker='<broker>', CELERY_BROKER_HEARTBEAT = 0)
- sattva_venubroker_pool_limit = None task_acks_late = True broker_heartbeat = 0 worker_prefetch_multiplier = 1
- Math is Hard