Closed Bug 1819737 Opened 1 year ago Closed 8 months ago

Add Extension Crash listener in GV to determine when we should restart the extension background pages

Categories

(GeckoView :: Extensions, task, P2)

All
Android

Tracking

(firefox118 fixed, firefox119 fixed)

RESOLVED FIXED
119 Branch
Tracking Status
firefox118 --- fixed
firefox119 --- fixed

People

(Reporter: zmckenney, Assigned: willdurand)

References

Details

(Whiteboard: [addons-jira])

Attachments

(4 files, 3 obsolete files)

When the Extension Process crashes, the crash report should check the auto-restart limit and restart the process if necessary

Blocks: 1535365
Severity: -- → N/A
Priority: -- → P2

After talking with other teams, we will want to have an extension crash listener that can determine which background pages to load. When the background pages are recreated/reloaded, the process will be restarted.

Summary: When Extension Process crashes use crash report to check extension alive (Gecko API) and restart if necessary → Add Extension Crash listener in GV to determine when we should restart the extension background pages
Whiteboard: [addons-jira]
Blocks: 1844138

This patch adds some (partial) logic to propagate the "extension-process-crash"
event to the embedders. We send a request with a response, which is then used
to determine what to do in gecko, i.e. whether we want to keep recreating the
process or not.

Assignee: nobody → wdurand
Status: NEW → ASSIGNED
Duplicate of this bug: 1819732
Blocks: 1846979
Blocks: 1847085
Blocks: 1847088
Depends on: 1847608
Attachment #9344764 - Attachment description: WIP: Bug 1819737 - Listen for extension process crashes and pass to new delegate methods → Bug 1819737 - Listen for extension process crashes and pass to new delegate methods
Attachment #9346657 - Attachment is obsolete: true
Attachment #9344764 - Attachment description: Bug 1819737 - Listen for extension process crashes and pass to new delegate methods → Bug 1819737 - Listen for extension process crashes and pass to new delegate methods r=willdurand
Attachment #9346652 - Attachment description: WIP: Bug 1819737 - Add deferred task and counter to monitor extensions process crashes. r?rpl! → Bug 1819737 - Add deferred task and counter to monitor extensions process crashes. r?rpl!
Blocks: 1848426

The patch that will close this bug adds the necessary GV bits so that when a crash happens, GV is notified. When too many crashes have occurred and Gecko disabled the extensions process spawning, GV will emit an event to the embedder (so that the app can show some UI to the user). In addition, the embedder will be able to enable the process spawning again with a new method on the WebExtension controller.

Bug 1848426 is where the Gecko logic will be added.

No longer blocks: 1848426
Depends on: 1848426

Comment on attachment 9346652 [details]
Bug 1819737 - Add deferred task and counter to monitor extensions process crashes. r?rpl!

Revision D185030 was moved to bug 1848426. Setting attachment 9346652 [details] to obsolete.

Attachment #9346652 - Attachment is obsolete: true
Attachment #9344639 - Attachment is obsolete: true
Blocks: 1848426
No longer depends on: 1848426
No longer blocks: 1846979
Blocks: 1846979
No longer blocks: 1844138
No longer blocks: 1847085
Pushed by zmckenney@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/43d2261c5611
Listen for extension process crashes and pass to new delegate methods r=geckoview-reviewers,willdurand,owlish,amejiamarmol
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch

Authored by Zac McKenney
https://github.com/mozilla-mobile/firefox-android/commit/5dfa25932930a94dcf062b3868ba3f692af65c96
[main] Bug 1819737 - Added extensions process crash handling

Flags: qe-verify+
Target Milestone: 118 Branch → 119 Branch

:mixedpuppy as per the uplift request process guide (which explains why I need your approval ;-)), I'd like to nominate the PR attached to this bug as a candidate to backport to the 118 branch given that the patch in GV landed in Fx118 already. Are you OK with that? Thanks!

Flags: needinfo?(mixedpuppy)
Flags: qe-verify+

I approve.

(In reply to William Durand [:willdurand] from comment #14)

:mixedpuppy as per the uplift request process guide (which explains why I need your approval ;-)), I'd like to nominate the PR attached to this bug as a candidate to backport to the 118 branch given that the patch in GV landed in Fx118 already. Are you OK with that? Thanks!

Flags: needinfo?(mixedpuppy)

Comment on attachment 9351466 [details] [review]
[mozilla-mobile/firefox-android] Bug 1819737 - Added extensions process crash handling (backport #3459) (#3491)

Beta/Release Uplift Approval Request

  • User impact if declined: None.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): This is low risk because it is covered by tests and the patch in itself doesn't do much. It is however a requirement for us to be able to enable the extensions process in Fx118 (via Nimbus) because that patch will enable some UI for end-users.

Note that only the Fenix patch (Pull Request) needs to be uplifted, the other patch (in GeckoView) made it to the 118 branch.

  • String changes made/needed:
  • Is Android affected?: Yes
Attachment #9351466 - Flags: approval-mozilla-beta?
Comment on attachment 9351466 [details] [review]
[mozilla-mobile/firefox-android] Bug 1819737 - Added extensions process crash handling (backport #3459) (#3491)

Approved for 118.0b5, thanks.
Attachment #9351466 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Authored by Zac McKenney
https://github.com/mozilla-mobile/firefox-android/commit/7cdf3ba65a030ce759fc69ab5c5d3b0b13f8488e
[releases_v118] Bug 1819737 - Added extensions process crash handling

Authored by https://github.com/pascalchevrel
https://github.com/mozilla-mobile/firefox-android/commit/1749836c16a42def748baced88f8ea030e0af0ca
[releases_v118] Merge pull request #3491 from mozilla-mobile/mergify/bp/releases_v118/pr-3459

Flags: qe-verify+
Flags: qe-verify+
Blocks: 1855405
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: