Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServoMedia::get can hang forever when setting document activity #31918

Open
gterzian opened this issue Mar 28, 2024 · 4 comments
Open

ServoMedia::get can hang forever when setting document activity #31918

gterzian opened this issue Mar 28, 2024 · 4 comments
Labels
A-content/media A-content/script Related to the script thread

Comments

@gterzian
Copy link
Member

While debugging, I'm running into a hang of the script-thread at

let media = ServoMedia::get().unwrap();

Note this call is using OnceCell.html#method.wait, which will block until another thread sets the value.

In servo, it seems setting the value would be done at

ServoMedia::init::<servo_media_dummy::DummyBackend>();

I am running into this while running a WPT test: /css/cssom-view/MediaQueryList-addListener-handleEvent.html

@gterzian gterzian added A-content/script Related to the script thread A-content/media C-untriaged New issues that haven't been triaged yet labels Mar 28, 2024
@gterzian
Copy link
Member Author

gterzian commented Mar 28, 2024

Seems to only happen at 86bcc32

Happens also on latest main.

@gterzian
Copy link
Member Author

So it seems that this particular call ends-up completing, but taking a very long time:

ServoMedia::init_with_backend(|| {

Note that the closure is called from within a thread:

https://github.com/servo/media/blob/c04bb3025320cf8cd75ecf00ab8cacb39ff81843/servo-media/lib.rs#L103

So the initial call doesn't block, but then later when script call get, it blocks until that previous call in the thread completes.

@gterzian gterzian removed the C-untriaged New issues that haven't been triaged yet label Mar 29, 2024
@mrobinson
Copy link
Member

This sounds like GStreamer building the plugin registry. We have this issue on MacOS in particular. The first time that Servo runs it spends over a minute building a new GStreamer plugin registry. I took a little time to investigate how we can eliminate this pause -- since we really only load a single set of plugins, but I'm unsure how we can deal with this.

@mrobinson
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-content/media A-content/script Related to the script thread
Projects
None yet
Development

No branches or pull requests

2 participants