Synchronize extension state across threads/processes/servers.

Review Request #3547 — Created Nov. 21, 2012 and submitted

Information

Djblets
master

Reviewers

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).
Description From Last Updated

Should we set self._last_sync_gen to None here?

daviddavid

Remove this?

daviddavid

?

daviddavid
david
  1. 
      
  2. djblets/extensions/base.py (Diff revision 1)
     
     
    Show all issues
    Should we set self._last_sync_gen to None here?
  3. djblets/extensions/tests.py (Diff revision 1)
     
     
     
     
    Show all issues
    Remove this?
  4. djblets/extensions/tests.py (Diff revision 1)
     
     
    Show all issues
    ?
  5. 
      
chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-1.7.x (ef10315)
Loading...