Closed Bug 945629 Opened 11 years ago Closed 9 years ago

Handle the Search Service XML serialization on shutdown

Categories

(Firefox :: Search, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: Paolo, Unassigned)

References

Details

Currently, there is no shutdown handling for the delayed serialization triggered by addParam. The DeferredTask delay is used only for saving the XML once in case of multiple consecutive calls. From bug 940408 comment 9:

"While building the AsyncSave module, I found that tests in particular are quite likely to try and shut down before delayed saves happen. Also, in the case of the Add-on Manager, there was a condition that triggered an attempt to write during shutdown so it was always losing the race.

If there's any chance that add-ons will use any of these APIs we need them to be shutdown-safe, because we don't want to leave an opening for an add-on to break us by using the API in its shutdown hook.

For testing this sort of async code, one technique I've used is to load the JSM under test directly, and then replace the module-global reference to the async service with a mock that the test driver controls (see for example the mock AsyncShutdown in toolkit/mozapps/extensions/test/xpcshell/head_addons.js, added by bug 925389, or the mock OS.File.writeAtomic in .../test_DeferredSave.js)"
Component: General → Search
Product: Toolkit → Firefox
After bug 1203167 is fixed, we may no longer save xml files to the profile for search.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.