FrameConnector fails if called twice in parallel
Categories
(DevTools :: Framework, defect)
Tracking
(Fission Milestone:M7a, firefox89 fixed)
Tracking | Status | |
---|---|---|
firefox89 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
Details
(Whiteboard: dt-fission-m3-mvp)
Attachments
(1 file)
While working on bug 1699493, I was having test failures on browser/components/extensions/test/browser/browser_ext_devtools_inspectedWindow_targetSwitch.js because of this.
The issue is that connectToFrame
is called twice at about the same time.
And this method calls:
https://searchfox.org/mozilla-central/source/devtools/server/connectors/frame-connector.js#46
mm.loadFrameScript("resource://devtools/server/startup/frame.js", false);
and
https://searchfox.org/mozilla-central/source/devtools/server/connectors/frame-connector.js#278
mm.sendAsyncMessage("debug:connect", { prefix, addonId });
twice in parallel.
On the other side of the process bridge, here:
https://searchfox.org/mozilla-central/source/devtools/server/startup/frame.js#53-54
const onConnect = DevToolsUtils.makeInfallible(function(msg) {
removeMessageListener("debug:connect", onConnect);
const mm = msg.target;
const prefix = msg.data.prefix;
const addonId = msg.data.addonId;
const conn = DevToolsServer.connectToParent(prefix, mm);
We end up calling connectToParent
twice with the same prefix, instead of twice with the two distinct prefixes. One for each connectToFrame call, one for each tab top level target.
Doing this leads to really cryptic issues of having all content process actors being instanciated twice for the same prefix and having the client to receive all response twice and be confused about unexpected packets.
Assignee | ||
Comment 1•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a6af447d7028 [devtools] Fix races when connecting to the same browser element twice in parallel. r=jdescottes
Comment 3•3 years ago
|
||
bugherder |
Description
•