#24523: django.apps.registry.populate() does not handle failures in
app_config.ready()
-------------------------------+--------------------------------------
     Reporter:  kalium99       |                    Owner:  nobody
         Type:  Bug            |                   Status:  new
    Component:  Uncategorized  |                  Version:  1.7
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------

Comment (by kalium99):

 Sure. The simplest way to recreate it is to have your prefork (or
 equivalent) MPM module configured as follows
 {{{
 <IfModule prefork.c>
 StartServers       1
 ServerLimit      1
 MaxClients       1
 </IfModule>
 }}}

 And have your WSGI conf setup just to use a single process and thread
 {{{
 WSGIDaemonProcess example processes=1 threads=1
 }}}

 Have a DB call (as in my case, although really you could throw any kind of
 exception) at app load time somewhere.

 Do the equivalent of the following (this assumes DB is running locally):
 {{{
 $ service mysqld stop
 $ service httpd restart
 }}}

 Then go to a URL in your app, and you should get a 500. At this point, the
 server will always 500 regardless of whether you bring your mysql server
 back up or not. The only way to fix it is to restart apache (after fixing
 the underlying DB issue). In this kind of contrived example, it seems like
 it's not that big a deal.

 It only really becomes annoying when you have a multiprocess model, and
 flaky infrastructure. Where you will randomly get 500's when using your
 app (depending on whether the process that your request is given to does
 or does not have this problem).

 Technically you could say this is NOTABUG, because the method clearly says
 it is not re-entrant. However I got the impression the intent is that it's
 not re-entrant when it has already *succesfully* run.

 If you think it's worthwhile fixing (and I'm not in fact missing
 something), I can write a patch for it.

--
Ticket URL: <https://code.djangoproject.com/ticket/24523#comment:4>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.edaf41cb74518513a730ae6f2470ea89%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to