Closed
Bug 1173641
Opened 9 years ago
Closed 9 years ago
MediaTaskQueue should drop its reference to the threadpool when it finishes shutting down
Categories
(Core :: Audio/Video, defect)
Core
Audio/Video
Tracking
()
RESOLVED
FIXED
mozilla41
Tracking | Status | |
---|---|---|
firefox41 | --- | fixed |
People
(Reporter: bholley, Assigned: bholley)
References
Details
Attachments
(3 files)
(deleted),
patch
|
jwwang
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
jwwang
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
jwwang
:
review+
|
Details | Diff | Splinter Review |
I just spent several hours debugging a really weird hang. It turned out to be the result of having MediaDecoderReader holding onto a reference to its task queue (indirectly, by virtue of having a mirror value).
The task queue keeps the thread pool alive, which in turn causes us to spin indefinitely at shutdown in SharedThreadPool::SpinUntilShutdown. And because that happens _before_ the final cycle collection, the MediaDecoderReader may still be held alive by script, causing the deadlock.
The solution would seem to be what I've written up in the bug title. Let's see if it works.
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8620757 -
Flags: review?(jwwang)
Assignee | ||
Comment 2•9 years ago
|
||
Attachment #8620759 -
Flags: review?(jwwang)
Assignee | ||
Comment 3•9 years ago
|
||
As soon as a class has a mirror or canonical, it's going to hold onto the task
queue until destruction anyway.
Attachment #8620760 -
Flags: review?(jwwang)
Assignee | ||
Comment 4•9 years ago
|
||
Assignee: nobody → bobbyholley
Comment 5•9 years ago
|
||
Comment on attachment 8620757 [details] [diff] [review]
Part 1 - Hoist shutdown promise resolution into a helper. v1
Review of attachment 8620757 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/media/MediaTaskQueue.cpp
@@ -237,5 @@
> MonitorAutoLock mon(mQueue->mQueueMonitor);
> MOZ_ASSERT(mQueue->mIsRunning);
> if (mQueue->mTasks.size() == 0) {
> mQueue->mIsRunning = false;
> - mQueue->mShutdownPromise.ResolveIfExists(true, __func__);
I was confused by why we resolve the shutdown promise here for mIsShutdown could be still false. Now you make it clear.
Attachment #8620757 -
Flags: review?(jwwang) → review+
Updated•9 years ago
|
Attachment #8620759 -
Flags: review?(jwwang) → review+
Updated•9 years ago
|
Attachment #8620760 -
Flags: review?(jwwang) → review+
Comment 7•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/accc0cd34d8a
https://hg.mozilla.org/mozilla-central/rev/1ffe1611a4cb
https://hg.mozilla.org/mozilla-central/rev/f94ef0d3b13d
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox41:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in
before you can comment on or make changes to this bug.
Description
•