#18251: multithreading deadlock in django.models.loading.get_apps
------------------------------+------------------------------------
     Reporter:  harm          |                    Owner:  nobody
         Type:  Bug           |                   Status:  new
    Component:  Core (Other)  |                  Version:  1.3
     Severity:  Normal        |               Resolution:
     Keywords:                |             Triage Stage:  Accepted
    Has patch:  0             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  0             |                    UI/UX:  0
------------------------------+------------------------------------

Comment (by akaariai):

 Could this work: in WSGIHandler, when serving request do:
 {{{
 from django.db.models.loading import app_cache_ready, get_apps
 if not app_cache_ready():
     get_apps()
 }}}

 I didn't put any lock in there - I think the get_apps call should be safe
 as it pretty much immediately acquires the write_lock of app_cache. You
 don't even need the if not app_cache_ready(), as get_apps() returns
 immediately if apps are already loaded. It reads better to me that way..

 Can you report if this works?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/18251#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to