[meta] Simplify WorkerPrivate's end-of-life flow
Categories
(Core :: DOM: Workers, task, P2)
Tracking
()
People
(Reporter: ytausky, Unassigned)
References
(Depends on 2 open bugs)
Details
(Keywords: meta)
Currently the circumstances that lead to WorkerPrivate
getting destructed are quite complicated: it can happen on more than one thread, it involves a self-smart pointer, etc. We're also aware of several bugs that lurk there. We should rethink how it happens and modify accordingly.
Updated•5 years ago
|
Comment 1•5 years ago
|
||
I think, this should have higher priority than P3, at least for the removal of raw pointers as of bug 1546331. But I agree that we should have a very close look at the lifetime of WorkerPrivate
in general, too, and besides the destruction paths even the usage from multiple threads might cause issues. I assume though, that we are not talking about massive parallel access on these data structures from more than two threads but that it is kind of serialized during run-time through the event loop and that we have at most the spawning thread and the worker thread itself accessing it. But this is just a wild guess/hope and should be verified - I did not even try to analyze the code, yet.
Maybe :perry can structure better the single tasks that should be done for this, probably promoting this to a meta-bug?
Updated•5 years ago
|
Updated•5 years ago
|
Comment 2•5 years ago
|
||
We start with a patch for bug 1546331 first.
Updated•5 years ago
|
Comment 3•5 years ago
|
||
This will probably become a meta bug (there's agreement that there should/will be work done for this). In particular, worker "busy counts" should be factored into WorkerRefs.
Comment 4•5 years ago
•
|
||
bug 1493591 might be related, too (crash during deconstructor call of WorkerPrivate). And it still gets fresh crash reports from time to time, though closed.
Updated•5 years ago
|
Comment 5•5 years ago
|
||
Start to make this a meta-bug.
Updated•5 years ago
|
Comment 6•5 years ago
|
||
Should we limit this to end-of-life? What about bugs like bug 1505409 ?
Comment 7•5 years ago
|
||
Or bug 1552663 ?
Updated•2 years ago
|
Description
•