Closed Bug 1727262 Opened 3 years ago Closed 3 years ago

MediaEventSource can cause shutdown hangs

Categories

(Core :: Audio/Video: Playback, task, P2)

task

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:

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!
Attached file Bug 1727262 - Add gtest. r?alwu! (deleted) —
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
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: