Don't attempt to unregister integrations after shutting down.

Review Request #8781 — Created Feb. 25, 2017 and submitted

Information

Djblets
release-0.10.x
918f013...

Reviewers

When a process terminates, both the extension managers and integration
managers are shut down, clearing all state. The order in which this
happens is not guaranteed, and it's very possible (and likely) for the
integration managers to shut down before the extension managers. When
this happens, any integrations registered by an extension through
BaseIntegrationHook will fail to unregister, leaving a handful of errors
in the console or logs.

We now have an enabled state on IntegrationManager that indicates
whether operations can be performed on the manager. This is set when
initialized, and cleared after calling shutdown(). BaseIntegrationHook
now checks this before attempting to unregister, keeping logs clean.

Ran some management commands and stopped seeing errors during shutdown.

Unit tests pass.

reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/integrations/manager.py
        djblets/integrations/tests/test_manager.py
        djblets/integrations/hooks.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/integrations/manager.py
        djblets/integrations/tests/test_manager.py
        djblets/integrations/hooks.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.10.x (f1f54e7)
Loading...