Synchronize extension state across threads/processes/servers.
Review Request #3547 — Created Nov. 21, 2012 and submitted
Synchronize extension state across threads/processes/servers. A lot of extension state was local to the process modifying the state. If one process enabled an extension or modified an extension's settings, other processes with existing knowledge of extensions would be out of date. Only new processes would get the new state. We now use a cache key to synchronize the state of an ExtensionManager. On every request, we check each ExtensionManager to see if it has expired. If it has, the ExtensionManager will be fully reloaded. Each unique type of ExtensionManager (as indicated by its 'key' property) will have its own cache key. This allows us to ensure synchronicity across processes or even servers. Unit tests were added to ensure this does not break.
Unit tests passed. Tried these tests without the synchronization code working, and they failed in the ways I expected. This needs more testing in production, but it seems to do what it should, and in practice, two ExtensionManager instances with the same ID should be very similar to two separate processes (mostly).
* Set _last_sync_gen to None by default. * Removed some commented out code. * Changed some commented out assertions to make them work.
Revision 2 (+218 -31)