uwsgi sometimes fork while the python interpreter is not in a main thread which results in a kind of deadlock
This is almost the same issue as this uwsgi issue.
It applies when setting clean_timeout
to 0 or when the trytond-stat
thread is started. It can be reproduced easily by computing a Fibonacci number in the thread and executing uswgi this way:
TRYTOND_DATABASE_NAMES=uwsgi_deadlock uwsgi -T --plugins python --module trytond.application:app --master --processes 2 --threads 4 --http localhost:8000 --venv ~/.local/share/virtualenvs/tryton/
We can solve it by preventing the execution of any thread before trytond.application
is completely executed.