Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Runtime Error Deadlock occurring randomly in Django

Tags:

django

Running Django in Python 3.7.9. I am using channels so daphne is used but even when I using gunicorn the same results are obtained.

The error below is appearing randomly.

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

I don't think this error has much to do with deadlock, but at times they are appearing together.

 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]

How can I resolve this?

like image 733
Nithin Varghese Avatar asked Jul 12 '21 06:07

Nithin Varghese


Video Answer


1 Answers

I resolved this error by downgrading asgiref:

requirements.txt

asgiref==3.3.2
like image 139
Steve Foerster Avatar answered Oct 20 '22 15:10

Steve Foerster