django - Django中随机发生的运行时错误死锁

标签 django

在 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/

相关文章:

python - Django-Graphene : On a model ChoiceField, graphene 需要一个类型但得到一个值

django - 有没有办法在模板中动态呈现 django 字段的隐藏版本?

python - Django + uwsgi + nginx 。导入错误 : No module named py

python - 如何存储 wiki 站点(vcs)

python - Django:如何在不使用默认管理员的情况下管理组和权限

python - 过滤通用外键

python - 反转 '',参数 '()' 和关键字参数 '{}' 未找到。 0 种模式已尝试 : []

python - “标签”对象没有属性 'count'

python - 在 ubuntu 中卸载 python 模块

django - 进行 "not in"查询