Closed Bug 1509267 Opened Last year Closed 8 months ago

Cleanup Remote Settings worker when inactive

Categories

(Firefox :: Remote Settings Client, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
Firefox 68
Tracking Status
firefox68 --- fixed

People

(Reporter: leplatrem, Assigned: leplatrem)

References

Details

Attachments

(1 file)

The operations that we moved to the worker are executed every time there a data change is published on the remote settings server. When nothing new is available, the synchronization is a no-op.

So far, with the current number of collections, it's been only a couple of times a week (at most). I therefore think it makes sense to clean it up when inactive.
See Also: → 1502146
I think the best step here is probably to make the actual worker lazy, by providing a getter that lazily inits the worker inside your custom worker class. When this lazy initter runs it can setTimeout a call to clean the worker up (just calling _worker.terminate() if there are no outstanding messages). Alternatively, if the calling code knows that it is done using the worker, you could just explicitly destroy the worker then without resorting to a setTimeout.
Assignee: nobody → mathieu
Pushed by mleplatre@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5765e6384ff1
Cleanup Remote Settings worker when inactive r=glasserc,dthayer
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
You need to log in before you can comment on or make changes to this bug.