#17303: Cached template loader can fail to find template in multi-threaded
environment
---------------------------------+------------------------------------
     Reporter:  andrey.gtx@…     |                    Owner:  nobody
         Type:  Bug              |                   Status:  new
    Component:  Template system  |                  Version:  SVN
     Severity:  Normal           |               Resolution:
     Keywords:                   |             Triage Stage:  Accepted
    Has patch:  1                |      Needs documentation:  0
  Needs tests:  0                |  Patch needs improvement:  0
Easy pickings:  0                |                    UI/UX:  0
---------------------------------+------------------------------------
Changes (by akaariai):

 * needs_better_patch:   => 0
 * stage:  Unreviewed => Accepted
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 Two comments about the patch, based on just reading the diff:
   - A comment in there warning about concurrency issues would be
 warranted.
   - The patch allows multiple loading of the cached_loaders list. I think
 this is OK, as find_template() (django.template.loader) does something
 similar:
 {{{
 global template_source_loaders
 if template_source_loaders is None:
     loaders = []
     for loader_name in settings.TEMPLATE_LOADERS:
         loader = find_template_loader(loader_name)
         if loader is not None:
             loaders.append(loader)
 }}}

 So, marking as accepted. A testcase would be good, but it would also be a
 bit hard to write (testing race-conditions isn't too easy). I will try to
 review this fully tomorrow. I will see if I can find a clean way to write
 a testcase + of course try to apply & test the patch.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17303#comment:1>
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