异步任务报错-Celery: WorkerLostError: Worker exited prematurely: signal 9 (SIGKILL)

现象:

  异步任务:

    测试环境正常,线上环境报错

 

使用celery 进行后端异步任务时,报错:

Celery: WorkerLostError: Worker exited prematurely: signal 9 (SIGKILL)

 

网上搜索答案:

https://intellipaat.com/community/6094/celery-workerlosterror-worker-exited-prematurely-signal-9-sigkill

主要原因是线程提前被杀死,异步任务未完成就退出了,

 

尝试修改supervisor中celery启动方式,无效

最终解决方案:

  升级依赖包版本号,

  pip uninstall celery 

  pip install celery==x.x.x

  同时也需要关注redis 的版本号,也可通过pip install -r requirements.txt对依赖包进行全部升级

 

 

  

你可能感兴趣的:(异步任务报错-Celery: WorkerLostError: Worker exited prematurely: signal 9 (SIGKILL))