Closed Bug 1622012 Opened 5 years ago Closed 5 years ago

Never run Marionette code if Marionette is not enabled

Categories

(Remote Protocol :: Marionette, defect, P1)

Version 3
defect

Tracking

(firefox-esr68 wontfix, firefox75 fixed, firefox76 verified)

VERIFIED FIXED
mozilla76
Tracking Status
firefox-esr68 --- wontfix
firefox75 --- fixed
firefox76 --- verified

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

If Marionette hasn't been enabled we shouldn't run any of its code. Right now this happens because the component registers the profile-after-change observer notification. And as such we register for various other notifications, and in the worst case quit Firefox if eg. a XML parse error happens. See bug 1616856 for details.

I would suggest that we read the value of the marionette.enabled pref only during startup, and never update it when a user changes the pref during runtime. That way we can safely skip all the observer registrations, and don't have to worry about inconsistent states.

Blocks: 1616856
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0656956fe08b [marionette] Read the "marionette.enabled" pref only during startup, and don't allow to change its value. r=marionette-reviewers,maja_zf https://hg.mozilla.org/integration/autoland/rev/5d11cda6e6ad [marionette] Only set environment prefs if Marionette is enabled. r=marionette-reviewers,maja_zf https://hg.mozilla.org/integration/autoland/rev/cd3e1f0bdeeb [marionette] Only initialize Marionette during startup if explicitely enabled. r=marionette-reviewers,maja_zf

The patch landed in nightly and beta is affected.
:whimboo, is this bug important enough to require an uplift?
If not please set status_beta to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(hskupin)

Thanks for the reminder. We should indeed uplift this test-patch to beta.

Flags: needinfo?(hskupin)
Whiteboard: [checkin-needed-beta]

Could we safely uplift this to 75?

Flags: needinfo?(hskupin)

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+1] from comment #8)

Thanks for the reminder. We should indeed uplift this test-patch to beta.

Ah, commented before I saw this - I think you normally need to request beta approval if you want uplift?

Yes you are right. Just clarified with RyanVM on Matrix.

Flags: needinfo?(hskupin)
Whiteboard: [checkin-needed-beta]

I just went through all the options for enabling Marionette, and I can verify with a Nightly build that only with those set Marionette will run.

Status: RESOLVED → VERIFIED

Comment on attachment 9133671 [details]
Bug 1622012 - [marionette] Only initialize Marionette during startup if explicitely enabled.

Beta/Release Uplift Approval Request

  • User impact if declined: Marionette registers some observer notifications during startup even when it hasn't been enabled. As result it will force close Firefox in case of XML parsing errors.
  • Is this code covered by automated tests?: No
  • 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): Disabling the registration of observer notifications won't cause Marionette to get partially initialized.
  • String changes made/needed: None
Attachment #9133671 - Flags: approval-mozilla-beta?
Attachment #9133669 - Flags: approval-mozilla-beta?
Attachment #9133670 - Flags: approval-mozilla-beta?

Comment on attachment 9133671 [details]
Bug 1622012 - [marionette] Only initialize Marionette during startup if explicitely enabled.

approved for 75.0b10

Attachment #9133671 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9133669 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9133670 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Regressions: 1632556
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: