Closed
Bug 1727262
Opened 2 years ago
Closed 2 years ago
MediaEventSource can cause shutdown hangs
Categories
(Core :: Audio/Video: Playback, task, P2)
Core
Audio/Video: Playback
Tracking
()
RESOLVED
FIXED
94 Branch
Tracking | Status | |
---|---|---|
firefox94 | --- | fixed |
People
(Reporter: pehrsons, Assigned: pehrsons)
References
Details
Attachments
(2 files)
This is similar to bug 1702823 but for mTarget
instead of mFunction
.
The solution cannot be the same, since Notify()
needs mTarget
, and syncing this through revocation status is impossible (races) unless we switch to a Mutex. mFunctionWrapper
could be removed on the target thread since that's where revocation happens.
Prerequisites:
- A MediaEventListener target that sits on top of a SharedThreadPool, for instance a TaskQueue (common), where the target's shutdown sequence is triggered by destruction, i.e., all hard refs to it are removed (probably not so common)
- A MediaEventProducer owned by a garbage collected object
Example sequence causing a shutdown hang:
- Listener is hooked up to the source
- XPCOM shutdown
- Listener is revoked (clearing the function but not the target)
- The MediaEventProducer owner is part of a ref-cycle and although CCed, lives on to CC-shutdown, which is after xpcom-shutdown-threads
- xpcom-shutdown-threads is blocked on a SharedThreadPool being alive
Assignee | ||
Comment 1•2 years ago
|
||
Updated•2 years ago
|
Attachment #9237705 -
Attachment description: Bug 1727262 - Add an escape hatch to MediaEventSource so it can clear all listeners and possibly unblock shutdown. r?alwu! → Bug 1727262 - Ensure MediaEventListener revocation eventually clears all members to prevent shutdown hangs. r?alwu!, r?bryce!
Assignee | ||
Comment 2•2 years ago
|
||
Updated•2 years ago
|
Attachment #9237705 -
Attachment description: Bug 1727262 - Ensure MediaEventListener revocation eventually clears all members to prevent shutdown hangs. r?alwu!, r?bryce! → Bug 1727262 - Ensure MediaEventListener revocation clears all members to prevent shutdown hangs. r?alwu!, r?bryce!
Pushed by pehrsons@gmail.com: https://hg.mozilla.org/integration/autoland/rev/0b8b1d0ee784 Add gtest. r=alwu https://hg.mozilla.org/integration/autoland/rev/46173dc5f5e6 Ensure MediaEventListener revocation clears all members to prevent shutdown hangs. r=alwu,bryce
Comment 4•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/0b8b1d0ee784
https://hg.mozilla.org/mozilla-central/rev/46173dc5f5e6
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
status-firefox94:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•