Closed Bug 1785294 Opened 2 years ago Closed 2 years ago

Consider to defer terminating non-persistent background context on pending calls to async API event listeners

Categories

(WebExtensions :: General, enhancement, P2)

enhancement

Tracking

(firefox106 fixed)

RESOLVED FIXED
106 Branch
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).

Assignee: nobody → lgreco
Attachment #9290331 - Attachment description: WIP: Bug 1785294 - Reset idle on API event listeners with a pending queryRunListener promise. → Bug 1785294 - Reset idle on API event listeners with a pending queryRunListener promise. r?mixedpuppy!
Status: NEW → ASSIGNED
Severity: -- → N/A
Priority: -- → P2
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

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).

Flags: needinfo?(lgreco)
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
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: