Consider to defer terminating non-persistent background context on pending calls to async API event listeners
Categories
(WebExtensions :: General, enhancement, P2)
Tracking
(firefox106 fixed)
Tracking | Status | |
---|---|---|
firefox106 | --- | fixed |
People
(Reporter: rpl, Assigned: rpl)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [addons-jira])
Attachments
(2 files)
This bug has been split from Bug 1781265, with the following motivations:
We would like to avoid forcing the extensions to apply changes to their listeners just to explicitly call a waitUntil method for async work (and related promise instances) that the WebExtensions API internals are already implicitly aware of (and have already access to the related promise instances).
In particular when the WebExtensions API internals will be calling an async listener, they will have access to a promise returned by calling the async listener (or to a promise that a non-async listener may be returning as its return value).
And so we agreed to look into making sure that we implicitly track promise returned by API listeners (and based on those defer terminating the background context for a bit longer if the promises are still pending, and eventually forcefully terminating the event page if they are still pending after a certain extended timeout).
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
Depends on D153525
Updated•2 years ago
|
Pushed by luca.greco@alcacoop.it: https://hg.mozilla.org/integration/autoland/rev/4b7c6808489d Reset idle on API event listeners with a pending queryRunListener promise. r=mixedpuppy https://hg.mozilla.org/integration/autoland/rev/fea7efce878b Allow pending async API event listeners calls to reset event page idle timeout only once. r=mixedpuppy
Comment 4•2 years ago
•
|
||
Backed out for causing xpcshell failures on test_ext_eventpage_settings.js, they look to be Android only.
Failure log: https://treeherder.mozilla.org/logviewer?job_id=388827465&repo=autoland
Backout link: https://hg.mozilla.org/integration/autoland/rev/fd5312d0bd6bd1361a1cff25042fee3c2842e992
Assignee | ||
Comment 5•2 years ago
|
||
I've updated D153525 to handle the additional failure, not sure why I missed in my pushes to try, when I tried it locally it failed also on Linux Desktop builds.
I took also a look to the other failures from the links in comment 4 and they looked unrelated (besides the same test_ext_eventpage_settings.js which also seems to have failed for the same reasons it failed on android).
Pushed by luca.greco@alcacoop.it: https://hg.mozilla.org/integration/autoland/rev/b34a5a23c322 Reset idle on API event listeners with a pending queryRunListener promise. r=mixedpuppy https://hg.mozilla.org/integration/autoland/rev/c08cf9edf5a5 Allow pending async API event listeners calls to reset event page idle timeout only once. r=mixedpuppy
Comment 7•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b34a5a23c322
https://hg.mozilla.org/mozilla-central/rev/c08cf9edf5a5
Description
•