Signal 11 in a celery task, and then triggering on_failure

那年仲夏 提交于 2021-01-29 07:18:57

问题


I'm having trouble debugging this and haven't made much progress. I have along running async celery task that'll sometimes hit a signal 11 (it's a recursive/CPU-bound function that can be run into stack size issues). So, for example:

Process 'ForkPoolWorker-2' pid:5494 exited with 'signal 11 (SIGSEGV)'

I'd like to modify my celery task, task class and request to catch this and trigger the on_failure function of the task class. I haven't had any luck though. I'm running this with a redis backend. The most relevant SO question I've found is Handle WorkerLostError in celery after SIGSEGV

I've set acks_late=True, but I'm not sure how to implement a custom request/task as described in the above link to get my desired behavior. Likewise, setting acks_late=True, reject_on_worker_lost=Truewill make the task retry but I'm not sure how to intercept it in a custom request

来源:https://stackoverflow.com/questions/64272736/signal-11-in-a-celery-task-and-then-triggering-on-failure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!