#28593: DEP 0201: Simplified routing syntax
-----------------------------+---------------------------------------------
     Reporter:  Tim Graham   |                    Owner:  nobody
         Type:  New feature  |                   Status:  closed
    Component:  Core (URLs)  |                  Version:  master
     Severity:  Normal       |               Resolution:  fixed
     Keywords:               |             Triage Stage:  Ready for checkin
    Has patch:  1            |      Needs documentation:  0
  Needs tests:  0            |  Patch needs improvement:  0
Easy pickings:  0            |                    UI/UX:  0
-----------------------------+---------------------------------------------

Comment (by Tim Graham <timograham@…>):

 In [changeset:"6f7279c4b1db894eb431c182ea9df5d665b3f726" 6f7279c]:
 {{{
 #!CommitTicketReference repository=""
 revision="6f7279c4b1db894eb431c182ea9df5d665b3f726"
 Refs #28593 -- Made URLResolver._populate() more resilient to signal
 interrupts.

 _populate() sets the populating attribute to prevent infinite recursion in
 case a urlconf includes itself. The flag is a threadlocal to avoid a race
 condition [1] where one thread sets the flag and another checks it, then
 proceeds to access data that's supposed to be populated (e.g.
 _reverse_dict)
 but isn't yet.

 The potential still exists for a thread to set the threadlocal, then be
 interrupted by a signal such as SIGALRM and raise before resetting the
 threadlocal flag. In this scenario, subsequent calls to _populate() in the
 same thread will short-circuit erroneously.

 The bulk of the method was already wrapped in a try/finally in df41b5a,
 but
 since a signal interrupt can occur at any line executed by the
 interpreter,
 this moves up the try to ensure threadlocal gets reset.

 [1]: https://groups.google.com/d/msg/django-
 developers/D_bIeinKHjE/4NmVQUJqAgAJ
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28593#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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.276deb75ffbae26aedf1bb3b87dfa028%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to