Closed Bug 1222247 Opened 9 years ago Closed 9 years ago

[e10s] SpecialPowers.addPermission() is racy

Categories

(Testing :: Mochitest, defect)

defect
Not set
normal

Tracking

(e10s+)

RESOLVED DUPLICATE of bug 951272
Tracking Status
e10s + ---

People

(Reporter: mccr8, Assigned: mccr8)

References

(Blocks 1 open bug)

Details

SpecialPowers.addPermission sends a sync message to the parent, which is good, but the parent process permission manager then sends an async message to the child processes to update their copies of the permissions store. This does not affect test code that calls SpecialPowers.hasPermission(), because that asks the parent process, but any C++ code that checks permissions can end up with the old version of the permission. The SpecialPowers code should probably take a promise or callback thing, observe perm-changed and wait for the permission it set, then trigger the callback.

An example of a test that fails in e10s due to this is dom/workers/test/test_xhr_parameters.html.
Assignee: nobody → continuation
tracking-e10s: --- → ?
Isn't that why people should use pushPermissions?
Yeah, I didn't see that before.
Maybe I could just add a warning to this interface when it used in a content process. I also added a note to the "e10s test tips" wiki page.
See also bug 951272, we had some volunteers working on this code for a while and then it got stalled.
But this is definitely causing intermittent failures sometimes.
I guess this bug isn't too useful.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.