Closed Bug 1679414 Opened 3 years ago Closed 3 years ago

MarionetteCommands actor leaks observers of dialog observer instance

Categories

(Remote Protocol :: Marionette, defect, P1)

Default
defect

Tracking

(Fission Milestone:M7, firefox-esr78 unaffected, firefox83 wontfix, firefox84 fixed, firefox85 fixed)

RESOLVED FIXED
85 Branch
Fission Milestone M7
Tracking Status
firefox-esr78 --- unaffected
firefox83 --- wontfix
firefox84 --- fixed
firefox85 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Regression)

Details

(Keywords: memory-leak, regression, Whiteboard: [marionette-fission-mvp][simple])

Attachments

(1 file, 1 obsolete file)

Just noticed that the MarionetteCommand actor creates an instance of the DialogObserver within actorCreated, and registers for all the following observer notifications:

Services.obs.addObserver(this, "common-dialog-loaded");
Services.obs.addObserver(this, "tabmodal-dialog-loaded");
Services.obs.addObserver(this, "toplevel-window-ready");

Sadly we do not remove those listeners in didDestroy, and as such these are going to leak.

As result I see tons of toplevel-window-ready notifications for TestClickCloseContext.test_click_close_window when running all tests in that file.

Whiteboard: [marionette-fission-mvp][simple]

Marking as being soft-blocked by bug 1678708 given that I want to add some tests and the other bug lays the basics for it.

Depends on: 1678708

Actually I cannot find a way with xpcshell tests to get this tested. We would need browser chrome tests but those aren't available for Marionette.

No longer depends on: 1678708
Attachment #9189880 - Attachment is obsolete: true

Tracking marionette-fission-mvp bugs for Fission M7 Beta milestone.

Fission Milestone: --- → M7
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b735561c9242
[marionette] Don't leak registered dialogObserver listeners in MarionetteCommands actor. r=marionette-reviewers,maja_zf
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch

Does this need a Beta uplift?

Flags: needinfo?(hskupin)
Regressed by: 1662803

Comment on attachment 9189882 [details]
Bug 1679414 - [marionette] Don't leak registered dialogObserver listeners in MarionetteCommands actor.

Beta/Release Uplift Approval Request

  • User impact if declined: When Firefox is under remote control eg by running Selenium tests the new actor implementation is leaking memory by not unregistering listeners and observer notifications.
  • 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): Ensures to unregister all listeners and observers when the JSWindowActor gets destroyed.
  • String changes made/needed:
Flags: needinfo?(hskupin)
Attachment #9189882 - Flags: approval-mozilla-beta?

Comment on attachment 9189882 [details]
Bug 1679414 - [marionette] Don't leak registered dialogObserver listeners in MarionetteCommands actor.

Approved for 84.0b7.

Attachment #9189882 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
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: