Attempt to fix DynamicURLResolver with threads.
Review Request #6606 — Created Nov. 18, 2014 and submitted
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.
Description | From | Last Updated |
---|---|---|
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot |