Closed Bug 1648631 Opened 4 years ago Closed 4 years ago

L10nRegistryService._synchronizeSharedData does not flush until the main thread is idle

Categories

(Core :: Internationalization, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: bugzilla, Assigned: bugzilla)

References

(Blocks 1 open bug)

Details

(Whiteboard: [geckoview:m80])

Attachments

(4 files)

L10nRegistryService._synchronizeSharedData() ends up calling mozilla::dom::ipc::WritableSharedMap::Set which sets a value in the map but does not immediately flush; instead it calls the private WritableSharedMap::KeyChanged method which queues up an idle-priority runnable to flush.

AFAICT this is what is causing various intermittent test failures in browser_resource_uri.js: the setting up of the mock source will not make it to the content process at the correct time if the parent main thread never gets a chance to sit idle.

Preallocation of content processes makes it less likely that the main thread will idle, since it doesn't need to wait for a new content process to start.

Setting a key/value pair on the parent process message manager's sharedData
initiates a pending runnable that runs at idle priority. If the current
thread never gets a chance to idle, then those registry changes will never be
synchronized.

This patch adds an explicit flush so that _synchronizeSharedData does indeed
actually synchronize.

Priority: -- → P1
Whiteboard: [geckoview:m80]
Attachment #9159547 - Attachment description: Bug 1648631: Make L10nRegistryService._synchronizeSharedData() explicitly flush; r=#fluent-reviewers → Bug 1648631: Part 1 - Make L10nRegistryService._synchronizeSharedData() explicitly flush and convert source registration to accept arrays; r=zbraniecki

Now that the L10nRegistry source registration APIs accept arrays, we modify
this code to work with the revised signature.

Depends on D81243

Pushed by aklotz@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/35cf713e8854 Part 1 - Make L10nRegistryService._synchronizeSharedData() explicitly flush and convert source registration to accept arrays; r=zbraniecki https://hg.mozilla.org/integration/autoland/rev/b8feea0d2f5a Part 2 - Update Extension.jsm to use the revised L10nRegistry APi; r=robwu https://hg.mozilla.org/integration/autoland/rev/15afb002fb3b Part 3 - Update tests to work with the revised L10nRegistry API; r=zbraniecki,robwu https://hg.mozilla.org/integration/autoland/rev/0a4b3f99d2d1 Part 4 - Update docs to reflect L10nRegistry interface change; r=zbraniecki
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: