Closed Bug 1848136 Opened 1 year ago Closed 9 months ago

Can't trace worker threads because of an exception

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(firefox123 fixed)

RESOLVED FIXED
123 Branch
Tracking Status
firefox123 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

The following exception prevents tracing the worker threads:
Error while calling actor 'tracer's method 'startTracing'" "Services.scriptSecurityManager is undefined"

This is especially easy to reproduce when enabling tracing from the browser toolbox.

This requires to manually toggle "dom.worker.console.dispatch_events_to_main_thread" to false
in order to spawn targets for workers.

I had to disable throttling for workers because of missing setTimeout/clearTimeout methods
in worker modules. Hopefully we could get access to these methods when migrating to ESM?

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

(In reply to Alexandre Poirot [:ochameau] from comment #1)

I had to disable throttling for workers because of missing setTimeout/clearTimeout methods
in worker modules. Hopefully we could get access to these methods when migrating to ESM?

WorkerDebuggerGlobalScope doesn't implement setTimeout, just setImmediate[1]. We can add one, but it would be good to understand the use case, especially if it's for something like batching where we might be able to add a custom API that could be potentially more power-saving aware if early and/or late transmission are both fine. By default we'd probably also cancel the timeouts when canceling the worker with no recourse.

1: This is implemented as a runnable and so will happen strictly after the microtask queue is processed but before any content runnables run. (We always process debugger runnables in preference over content runnables.)

This requires to manually toggle "dom.worker.console.dispatch_events_to_main_thread" to false
in order to spawn targets for workers.

I had to disable throttling for workers because of missing setTimeout/clearTimeout methods
in worker modules. Hopefully we could get access to these methods when migrating to ESM?

(In reply to Andrew Sutherland [:asuth] (he/him) from comment #2)

WorkerDebuggerGlobalScope doesn't implement setTimeout, just setImmediate[1]. We can add one, but it would be good to understand the use case, especially if it's for something like batching where we might be able to add a custom API that could be potentially more power-saving aware if early and/or late transmission are both fine. By default we'd probably also cancel the timeouts when canceling the worker with no recourse.

For now, I think it is fine not having throttling in workers.
The upcoming migration to ESM may force us to expose more of these typical globals to worker debugger.
So I'm tempted to wait for this to happen first.
Also, throttling would become much more important if we were throttling all resources (bug 1824726). Until it is limited only to traces, it isn't such a big deal.

Attachment #9348402 - Attachment is obsolete: true
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c75184afce33
[devtools] Enable tracing from worker threads. r=devtools-reviewers,nchevobbe
Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 123 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: