Closed Bug 1672826 Opened 4 years ago Closed 4 years ago

ChildDebuggerTransport isn't closed on the parent process side (at least for content process targets)

Categories

(DevTools :: Framework, defect)

defect

Tracking

(firefox84 fixed)

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

Details

Attachments

(2 files)

Test failure in bug 1672660 highlighted that the ChildDebuggerTransport isn't closed on the parent process side.

When the process helper module's destroyTargets method is called, we broadcast an event to all content processes, but don't do anything on the parent process side (where process-helper.js executes).
But we should be destroying the ChildDebuggerTransport that is created from onContentProcessActorCreated method. Otherwise, if late messages are sent by the content process, we may still try to interpret them whereas they should be ignored.
Not doing this correctly leads to following errors:

"TypeError: can't access property "send", this.transport is null" {file: "resource://devtools/server/devtools-server-connection.js" line: 99}]

This happens because the ChildDebuggerTransport is still receiving messages and forward it to the main DevToolsServerConnection running in the parent process. Connection which is destroyed just after we call unwatchTargets, as the toolbox is most likely closing.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED

Previous purgeRequestForDestroy method was only rejecting all pending requests.
The new syncFrontDestroy allows to fully destroy the front, including
unregistering it/unmanage it. So that if we receive a packet from a brand new
actor, with the same prefix and actor ID, DevToolsClient.getFront doesn't return
the old destroyed front.
This issue was making pending requests that were never resolved.

Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b6d78ba82b0d
[devtools] Close ChildDebuggerTransport in the parent process when we destroy content process targets. r=nchevobbe
https://hg.mozilla.org/integration/autoland/rev/fdc2974ccfc0
[devtools] Unmanage fronts when we purge a whole prefix. r=nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: