Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Runtime Error Deadlock occurring randomly in Django #5

Closed
gaoyi-ai opened this issue Aug 27, 2021 · 1 comment
Closed

Error: Runtime Error Deadlock occurring randomly in Django #5

gaoyi-ai opened this issue Aug 27, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@gaoyi-ai
Copy link
Owner

After the WebSocket is connected, here has trouble with RuntimeError (Error message: Single thread executor already being user, would deadlock)

@gaoyi-ai gaoyi-ai added the bug Something isn't working label Aug 27, 2021
@gaoyi-ai gaoyi-ai self-assigned this Aug 27, 2021
@gaoyi-ai
Copy link
Owner Author

Try pip install asgiref==3.3.4.

I noticed the RuntimeError: Single thread executor already being used, would deadlock after installing asgiref 3.4.1.

This appears to be due to a currently unresolved issue in channels 3.0.4 where concurrent requests on the Django development server are intermittently failing. See also Runtime Error Deadlock occurring randomly in Django. link: ASGIRef 3.4.1 + Channels 3.0.3 causes non-deterministic 500 errors serving static files #1722

In 3.4.0, asgiref introduced additional deadlock checks. That's a good thing, but may have exposed an underlying issue in channels. From the changelog:

Calling sync_to_async directly from inside itself (which causes a deadlock when in the default, thread-sensitive mode) now has deadlock detection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant