Can't trace worker threads because of an exception
Categories
(DevTools :: Debugger, defect, P3)
Tracking
(firefox123 fixed)
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.
Assignee | ||
Comment 1•1 year ago
|
||
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?
Updated•1 year ago
|
Comment 2•1 year ago
|
||
(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.)
Assignee | ||
Comment 3•9 months ago
|
||
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?
Assignee | ||
Comment 4•9 months ago
|
||
(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.
Updated•9 months ago
|
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c75184afce33 [devtools] Enable tracing from worker threads. r=devtools-reviewers,nchevobbe
Comment 6•9 months ago
|
||
bugherder |
Description
•