问题
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=True
will 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