Split off from bug 671894, since it's separate enough for its own bug. Comment from bug 671894 comment 31 describing this: > Been trying to figure out potential problems and solutions here. One thing > I've seen in a number of logs is evidence of something attempting to access > the add-ons manager after it has been shutdown. I can only guess at three > causes for this, a fault in our code, or some add-on either shutting down > the add-ons manager itself or calling it during shutdown. Either that or an > async operation is waiting to complete when we start shutdown and completes > after, trying to use the DB again in the process. > > When this happens the DB is already locked and so we attempt to delete it > and recreate from scratch to continue, but since the add-ons manager is > shutdown most of the variables we need are uninitialised so this fails > probably leaving an empty DB in the profile. This is probably why some > people see empty add-ons lists until they install a new add-on (causes a > complete re-scan of the profile). > > This first patch attempts to protect against a lot of this. It removes the > currently fairly visible API to shutdown the add-ons manager (it's still > possible to do, just harder) and rejects any attempts to use the API while > it is shutdown.
Created attachment 652020 [details] [diff] [review] Patch v2 Patch from bug 671894. Carrying over review, as all I did was fix the bitrot.
Bah, backed out thanks to orange on *everything* for debug builds (opt builds are all fine): https://hg.mozilla.org/integration/fx-team/rev/7a847385e42b Seeing this everywhere: Assertion failure: !connections[i]->ConnectionReady(), at ../../../storage/src/mozStorageService.cpp:853 That seems to be happening on shutdown. Example logs: https://tbpl.mozilla.org/php/getParsedLog.php?id=14393594&full=1&branch=fx-team#error0 https://tbpl.mozilla.org/php/getParsedLog.php?id=14395245&tree=Fx-Team&full=1#error0
That was due to a typo in AddonManagerInternal.observe(), causing AddonManagerInternal.shutdown() to never be called. Going to run this through Try just to be sure.