I have a python module with c++ code using pybind11 that I have imported in my django + celery 3.1.25 app. The c++ code contains assertions that might trigger inside of a celery worker which then leads to the WorkerLostError
.
I have tried to put the calls to the python c++ module inside try:
except:
scopes, however this does not work and the celery worker still crashes.
I have also tried to bind an error callback function using the link_error=
argument in my apply_async
call to my celery task, however the method never gets called.
Ideally I would like to catch the error somehow so I can display an error message to the user. Any suggestions is appreciated!