Stop using Promise.jsm from devtools/shared/defer
Categories
(DevTools :: General, defect, P3)
Tracking
(firefox70 fixed)
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
(Depends on 1 open bug)
Details
Attachments
(1 file)
Assignee | ||
Comment 1•7 years ago
|
||
Updated•7 years ago
|
Updated•7 years ago
|
Comment 2•7 years ago
|
||
Updated•6 years ago
|
Assignee | ||
Comment 3•6 years ago
|
||
Comment hidden (mozreview-request) |
Assignee | ||
Comment 5•6 years ago
|
||
Comment 6•6 years ago
|
||
mozreview-review |
Comment 8•6 years ago
|
||
Assignee | ||
Comment 9•6 years ago
|
||
Comment 10•5 years ago
|
||
The failures are no longer there: https://treeherder.mozilla.org/#/jobs?repo=try&revision=5cd5d3ddfc93c3392294c1857822f06d5efc3691
Let's see if it will stick this time!
Comment 11•5 years ago
|
||
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/mozilla-inbound/rev/2078b58fe83a
Stop using Promise.jsm from devtools/shared/defer. r=jryans
Assignee | ||
Comment 12•5 years ago
|
||
Panos, be careful about the landmine you are walking on here.
This bug was blocked on bug 1455421 and the issues around Zombie promises.
This zombie promises issue was only highlighted by the now-removed shader editor and webaudio panels.
Only these panels were making try to fail. But that particular issue may impact any panel.
A zombie Promise is a DOM Promise coming from the panels (inspector, console, ...)
which becomes zombie when the related panel's document is destroyed.
These promises may come from a call doing new Promise()
, but also from async function(){}
, which returns a Promise.
When the panel is destroyed, these promise may be stall and never resolve, even if some chrome code call their resolve or reject handler!
This leads to half destroyed blank toolbox, which can't be toggled on again.
I was confused about why this particular patch was trigerring an issue similar to the zombie promises,
as devtools/shared/defer
should never be loaded as a Browser Loader module and so, never use DOM Promises coming from the panel's document. So I don't know how much trouble we can get out of it...
The very latest action item to unblock us here is to work on bug 1529621.
If we get rid of all async destruction code, we can then safely get rid of Promise.jsm.
Until then, we can't fully switch to DOM Promises.
Comment 13•5 years ago
|
||
Thanks for the heads up, I appreciate the background information. I've read through the referenced bugs and it sounds like the plan you have laid out is the right one.
I'm ambivalent about what specifically to do about this patch. Since all the breakage that has been discovered in the past (comment 8, bug 1402779, bug 1455226) has either been in panels that we have removed or panels that we have fixed, I don't see a way to verify whether this patch will create breakage at all. Not having an automated test to catch this is clearly a problem, but I would even settle for a manual test. So far all my attempts to reproduce the breakage have been unsuccessful, and I've tried many panels that have been mentioned in these bugs (console, inspector, memory, perf, etc.) in various configurations (docked, undocked, etc.).
Based on the above, I'm leaning towards letting this patch get merged to m-c and see if we get any bug reports to back it out. Would you rather have it backed out immediately instead?
Comment 14•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Assignee | ||
Comment 15•5 years ago
|
||
(In reply to Panos Astithas (he/him) [:past] (please ni?) from comment #13)
Based on the above, I'm leaning towards letting this patch get merged to m-c and see if we get any bug reports to back it out. Would you rather have it backed out immediately instead?
In theory, this patch shouldn't trigger zombie promises.
So it is really unclear why it triggered zombie promises-like failures back in the days. May be it was only a timing issue?
I agree that it should be ok to keep it landed. My warning was especially about doing any progress on removing the last bits of Promise.jsm, which, for sure could trigger the zombie promises.
One intermediate step you could do if you are looking forward removing Promise.jsm is to replace them by the special "always alive" DOM Promise.
So instead of removing promise = require("promise")
and replace promise
by Promise
,
which would switch from Promise.jsm to DOM Promise,
you could do replace the import by promise = require("Promise")
and replace promise
by Promise
.
This would switch from Promise.jsm to "always alive" DOM Promise coming from a special chrome context.
This could still slightly change the timings and highlight an already existing zombie promise. But by itself it doesn't introduce new case of potential zombie promises. We typically have zombie promises today when we are using async function in any destroy codepath of the panels.
Description
•