Opened 2 years ago
Last modified 2 years ago
#33745 closed Bug
There is no easy way to turn off sync_to_async and async_to_sync adapters — at Version 4
Reported by: | abetkin | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | 4.0 |
Severity: | Release blocker | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Hi! I have a setup that is deployed with nginx unit (https://unit.nginx.org)
I have 1 asgi and 1 wsgi application, namely for my sync and async endpoints. All my code runs natively, there is no need to adapt my code with sync_to_async-like stuff.
If an async endpoint somehow (by mistake) gets routed to the wsgi application, it is AN ERROR for me. Because it should have been routed to the asgi app. However, django will silently adapt it and run in a separate thread.
The same happens if a sync endpoint is dispatched to the asgi application. Again, I want that to be an error!
I haven't found any easy way to turn this behavior off or even to check that this is happening, to log it somewhere. I think this is wrong.
Change History (4)
comment:1 by , 2 years ago
Description: | modified (diff) |
---|
comment:2 by , 2 years ago
Description: | modified (diff) |
---|
comment:3 by , 2 years ago
Description: | modified (diff) |
---|
comment:4 by , 2 years ago
Description: | modified (diff) |
---|