stephenmcd/mezzanine — pull request #1126 by AlexHill (2014-10-08 01:55:20+00:00)
Title: Resolve race condition in conf.settings

In a multithreaded environment a race condition exists in the Settings object. This can mean that code using mezzanine.conf.settings doesn't see all the database-backed settings, and instead sees values from settings.py or the defaults. It can be resolved using a threading lock as in this PR.

The race condition is exacerbated by the high churn of ``_loaded`` and ``_editable_cache`` caused by frequent use of ``use_editable``. Would it be possible to have use_editable be an idempotent operation that registers signal handlers on the Setting object, and update the editable cache in those?