Closed Bug 1672778 Opened 4 years ago Closed 4 years ago

ThreadActor is not destroyed when content process target is destroyed

Categories

(DevTools :: Debugger, defect)

defect

Tracking

(firefox84 fixed)

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

Details

Attachments

(2 files)

ContentProcessTargetActor isn't calling ThreadActor.exit, whereas this is the only way to fully destroy this special actor. That's because ThreadActor.destroy isn't calling Actor.destroy. Instead ThreadActor.exit does it.
So that destroying the target actor, which manages the thread actor, will call all its children actor's destroy method. But we expect to call exit.

BrowsingContext target actor has a special code to do that right:
https://searchfox.org/mozilla-central/source/devtools/server/actors/targets/browsing-context.js#1011
https://searchfox.org/mozilla-central/source/devtools/server/actors/targets/browsing-context.js#1046
https://searchfox.org/mozilla-central/source/devtools/server/actors/targets/browsing-context.js#641
https://searchfox.org/mozilla-central/source/devtools/server/actors/targets/browsing-context.js#620

We could probably benefit from cleaning up/removing this "exit" logic in favor of a unique destroy codepath.

We have to manually call exit as calling destroy won't completely destroy it.
ThreadActor.destroy do not call protocoljs.Actor.destroy, ThreadActor.exit does it.

This may prevent logging a few exception or error messages.
But thanks to the other patch of this bug, we should try to stop listening
for sources as soon as the thread actor is destroyed.

Blocks: 1673328
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9620179e672b [devtools] Destroy the thread actor when the content process actor is destroyed. r=nchevobbe https://hg.mozilla.org/integration/autoland/rev/43b98bc28bdc [devtools] Avoid trying to send new-source event if the thread actor has been destroyed. r=nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
No longer blocks: 1453436
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: