Created attachment 408468 [details] Shutdown stacks On my windows VM sometimes shutdown takes forever. When I break I see that the main thread is waiting to join the safebrowsing thread, but it's still processing lots of updates and using sqlite extensively. I don't know anything about the architecture here but would it be possible to interrupt this processing and run the updates later? I'll attach the stacks from both threads.
whoops, I think if we switch the mozStorage to executeAsync, we can cancel the current query? is that right sdwilsh?
I'm wondering if you would create an observer that detects XPCOM shutdown each time you run the db update. If you detect XPCOM shutdown, you call reset() on the statement. Would that rollback the transaction, which would make url-classifier start over on the next startup?
Looks like there is a "cancelUpdate" call in the dbService: http://mxr.mozilla.org/mozilla-central/source/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp#3289
You could do that with executeAsync, but in this case it doesn't matter. You'd just want to stop processing any updates, and do it at next startup.
Looks like there is an observer registered for xpcom-shutdown-threads http://mxr.mozilla.org/mozilla-central/source/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp#3962 Would we need to add another observer for 'xpcom-shutdown' explicitly?
The old sqlite DB is gone, I do hope the new one shuts down faster. :)