Closed Bug 1691986 Opened 3 years ago Closed 1 month ago

Get rid of special thread attach sequence for workers

Categories

(DevTools :: Debugger, enhancement, P3)

enhancement

Tracking

(firefox126 fixed)

RESOLVED FIXED
126 Branch
Tracking Status
firefox126 --- fixed

People

(Reporter: ochameau, Assigned: ochameau, NeedInfo)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Thanks to bug 1681698, we should be able to set breakpoints before any target starts running, including workers.
So that we should be able to get rid of the worker specific codepath, where workers are frozen until the frontend calls threadActor.attach, with the breakpoints.
Instead we could avoid freezing the worker at all, and let Watcher code bootstrap the thread actor before the worker starts running, with the breakpoints information already available.

Severity: -- → S3
Priority: -- → P3

We used to wait for the thread actor to be attached before resuming
the execution of the worker. But now that breakpoints are now
always available on the server side, we can automatically resume
once we processed the Session Data and so, registered all the breakpoints.

In this changeset, we also merge the legacy WorkerTargetActor's attach
method into its constructor, so that the ThreadActor is always ready.

browser_dbg-windowless-service-workers.js fails because sessionData
isn't passed to worker-connector's connectToWorker.
That's because service workers are still instantiated from the client.
We still instantiate a WorkerDescriptor which is unrelated to the Watcher
and can't have easy access to its SessionData (which is keyed per Watcher and
not per DevToolsServerConnection).

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e29a81bc7299
[devtools] Revisit worker attach on the server. r=devtools-reviewers,nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 125 Branch

Backed out for causing Bug 1767717 into permafail.

Could you please take a look?
Thank you!

Flags: needinfo?(poirot.alex)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 125 Branch → ---
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/586edf854d2c
[devtools] Revisit worker attach on the server. r=devtools-reviewers,nchevobbe
Status: REOPENED → RESOLVED
Closed: 1 month ago1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 126 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: