-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
_DeadlockError on import of django.test.signals #7078
Comments
Hi, Thanks for your detailed report. |
Hi, I know I didn't follow the contribution guide to a T, but would it be possible to have more of a discussion around this? Even if it is an issue with Django, wouldn't mitigating the problem for users of DRF be worth looking into? If this simply isn't possible I'll drop the issue. I'm only concerned for the experience of users of DRF as the error this problem induces is kind of hard to track down and can be frustrating when debugging as you have to keep restarting the debug server. The recommended fix I saw in those threads of removing .pyc files doesn't even work for me. The only fix that works (at least for me through empirical testing) is removing the dependency on |
What if that import was moved inside this function ? Does the issue still happen after that ? |
Moving the import inside the function that it's used in does seem to fix the issue as well. |
Just a note - I assume Tom closed the issue assuming it's an upstream Django bug. Bug reports aren't closed just because they don't precisely follow the contribution guide. If you can't provide a test case, can you provide an example failing project? |
I can't provide the exact repository, but I should have some time in the next few days to try and assemble a minimal one. I'll update this issue once I've done so. I figured the fact that it's probably a Django bug prompted the closure which I understand. |
Meanwhile, we may mitigate the issue by moving the import. Sounds reasonable to me to accept a PR about it |
I closed the issue because it seemed unrelated to REST framework itself, particularly given that there were referenced Django tickets. Why is there a deadlock error with making an import from Django? That seems 😬. |
@tomchristie I agree, but is it sensible enough to move the import so most use cases will presumably work. |
Indeed. |
Closed in #7083 |
* Version 3.11 * Added notes on OpenAPI changes for 3.11. * Minor docs tweaking * Update package version and supported versions * Use a lazy import for django.test.client.encode_mutlipart. Closes #7078
* Version 3.11 * Added notes on OpenAPI changes for 3.11. * Minor docs tweaking * Update package version and supported versions * Use a lazy import for django.test.client.encode_mutlipart. Closes encode#7078
* Version 3.11 * Added notes on OpenAPI changes for 3.11. * Minor docs tweaking * Update package version and supported versions * Use a lazy import for django.test.client.encode_mutlipart. Closes encode#7078
Hey y'all, I've been intermittently receiving an error that looks like this:
(Ignore the
...
just removing user paths for privacy)I've tried for awhile to build a test case to make this easier to track down but was unsuccessful. I was able though to successfully make this go away. Here it seems that the
django.test.client.encode_multipart
function is being used withinrenderers.MultiPartRenderer
.Now re-using code seems fine to me, but I'm a bit hesitant to say that using code designed purely for testing purposes is something that should be done within production code. I've confirmed that copying that function and moving it elsewhere fixes this issue for me (and I've found that I'm not necessarily the only one suffering from this issue as seen here.
Looking at your contribution guide I know it says to talk about the expected behavior rather than code, but it seemed unavoidable to me to make this about the code causing the problem. Would anyone have any suggestions for getting this fixed seeing as it seems kind of tough to reproduce? As an outsider of this project I'd say though that not relying on a function designed for use in testing would be optimal.
I am running django-channels 2.2.0 with Django 2.2.5 at the moment if that helps narrow it down. I mention this because django-channels does replace the default runserver command with its own.
The text was updated successfully, but these errors were encountered: