在 Python 3.7.9 中运行 Django。我正在使用 channel ,因此使用了达芙妮,但即使我使用 gunicorn 也获得了相同的结果。
下面的错误是随机出现的。
ERROR 2021-07-12 11:55:07,478 HTTP GET /static/customer/assets/js/jquery.min.js 500 [0.71, 127.0.0.1:55466]
ERROR 2021-07-12 11:55:07,479 Exception inside application: Single thread executor already being used, would deadlock
Traceback (most recent call last):
File "/home/x/.pyenv/versions/3.7.9/lib/python3.7/site-packages/channels/http.py", line 192, in __call__
await self.handle(body_stream)
File "/home/x/.pyenv/versions/3.7.9/lib/python3.7/site-packages/asgiref/sync.py", line 410, in __call__
"Single thread executor already being used, would deadlock"
RuntimeError: Single thread executor already being used, would deadlock
我认为这个错误与死锁关系不大,但有时它们会同时出现。 ERROR 2021-07-12 11:55:07,478 HTTP GET
/static/customer/assets/js/jquery.min.js 500 [0.71, 127.0.0.1:55466]
我该如何解决这个问题?
最佳答案
我通过降级 asgiref 解决了这个错误:
要求.txt
asgiref==3.3.2
关于django - Django中随机发生的运行时错误死锁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68343003/