Potential dispatching in ProfilerParent may happen after thread shutdown
Categories
(Core :: Gecko Profiler, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox78 | --- | fixed |
People
(Reporter: mozbugz, Assigned: mozbugz)
References
Details
Attachments
(1 file)
Spawned from bug 1637890 and https://phabricator.services.mozilla.com/D75497#2298876
ProfilerParentTracker is destroyed during the ShutdownFinal
phase, during which it closes extant channels, which may cause pending promises to be rejected, and that triggers a dispatch to handle the rejection.
We should prevent this late dispatch. Some possible solutions:
A. Destroy ProfilerParentTracker earlier (Shutdown
or ShutdownThreads
phase). I'm not entirely sure if it's safe to manually close channels.
B. Reject promises earlier, but we'd have to handle potential late messages -- is that even possible?
C. Disconnect promise handlers, but that's more code to keep track of them, and I'm not sure it would prevent dispatching?
The fix for bug 1637890 should solve the crash, but it would still be nice to do the right thing!
Comment 1•5 years ago
|
||
(In reply to Gerald Squelart [:gerald] (he/him) from comment #0)
C. Disconnect promise handlers, but that's more code to keep track of them, and I'm not sure it would prevent dispatching?
If you use a MozPromiseRequestHolder to hold the promise returned by IPDL; disconnecting will prevent any tasks from being dispatched.
Assignee | ||
Comment 2•5 years ago
|
||
When the tracker is destroyed, any extant channel is closed, this can trigger the rejection of pending promises, which dispatch tasks to promise handlers. So we need to ensure that this happens before threads cannot service dispatches anymore.
Updated•5 years ago
|
Comment 4•5 years ago
|
||
bugherder |
Description
•