Attempt to fix DynamicURLResolver with threads.

Review Request #6606 — Created Nov. 18, 2014 and submitted — Latest diff uploaded

Information

Djblets
release-0.8.x
3ec8d51...

Reviewers

We had some occasional bugs where Django would fail to look up items
from URL resolvers, generating a HTTP 500. This is likely due to a
lookup occurring while the cache is being cleared.

This change attempts to improve the way we handle clearing of caches.
Instead of wiping the entries and expecting Django's URLResolvers to
rebuild them when appropriate, we now directly call their _repopulate()
method. This method will generate new copies of the dictionaries and
then immediately set them, without leaving any time where the
dictionaries would be empty.

This should ensure that a valid lookup will always succeed, without any
risk of the types of failures we've seen.

It also surrounds this in a lock, hopefully preventing any clashes
during the repopulation process.

Unit tests pass.

    Loading...