Delay database access in ExtensionManager.

Review Request #14767 — Created Jan. 8, 2026 and updated

Information

Djblets
release-6.x

Reviewers

For production code, the ExtensionManager instance is typically
created as part of application init, because it needs to contribute to
URLs. This was causing database access to occur before apps were fully
ready, spewing warnings.

This change adds a delay_init parameter to the ExtensionManager
constructor. When this is set to True, we hold off on creating the
GenerationSynchronizer until later. For unit tests, we pass this in as
False. For real code, we pass this in as True and then the load()
method will end up finishing the initialization.

  • Ran unit tests.
  • Ran the Review Board devserver (with some matching changes to that
    codebase) and saw no more errors about early database access.
Summary ID
Delay database access in ExtensionManager.
For production code, the `ExtensionManager` instance is typically created as part of application init, because it needs to contribute to URLs. This was causing database access to occur before apps were fully ready, spewing warnings. This change adds a `delay_init` parameter to the `ExtensionManager` constructor. When this is set to `True`, we hold off on creating the `GenerationSynchronizer` until later. For unit tests, we pass this in as `False`. For real code, we pass this in as `True` and then the `load()` method will end up finishing the initialization. Testing Done: - Ran unit tests. - Ran the Review Board devserver (with some matching changes to that codebase) and saw no more errors about early database access.
lwzvyznkkpxoyssqqvlslkpxqoxymuzu
Checks run (2 succeeded)
flake8 passed.
JSHint passed.