• Daniel Tao's avatar
    Refs #28593 -- Made URLResolver._populate() more resilient to signal interrupts. · 6f7279c4
    Daniel Tao yazdı
    _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 df41b5a0, 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
    6f7279c4
Adı
Son kayıt (commit)
Son güncelleme
.tx Loading commit data...
django Loading commit data...
docs Loading commit data...
extras Loading commit data...
js_tests Loading commit data...
scripts Loading commit data...
tests Loading commit data...
.editorconfig Loading commit data...
.eslintignore Loading commit data...
.eslintrc Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.hgignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.rst Loading commit data...
Gruntfile.js Loading commit data...
INSTALL Loading commit data...
LICENSE Loading commit data...
LICENSE.python Loading commit data...
MANIFEST.in Loading commit data...
README.rst Loading commit data...
package.json Loading commit data...
setup.cfg Loading commit data...
setup.py Loading commit data...
tox.ini Loading commit data...