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

Handle errors from AudioRenderThread::start #424

Merged
merged 8 commits into from
Aug 18, 2024

Conversation

Taym95
Copy link
Contributor

@Taym95 Taym95 commented Aug 12, 2024

Part of servo/servo#32986, in order to handle errors in Servo, we need to remove panics and return errors.

Signed-off-by: Taym <haddadi.taym@gmail.com>
@Taym95
Copy link
Contributor Author

Taym95 commented Aug 12, 2024

@jdm FYI

@jdm
Copy link
Member

jdm commented Aug 12, 2024

Oops, I should have mentioned that there was someone else already looking into servo/servo#32986.

@Taym95 Taym95 marked this pull request as draft August 12, 2024 16:22
@Taym95 Taym95 force-pushed the fix/handle-audiorenderthread-errors branch 3 times, most recently from 8a9e636 to b9b4670 Compare August 12, 2024 16:58
Signed-off-by: Taym <haddadi.taym@gmail.com>
@Taym95 Taym95 force-pushed the fix/handle-audiorenderthread-errors branch from b9b4670 to aa2dd33 Compare August 12, 2024 17:00
@jdm
Copy link
Member

jdm commented Aug 12, 2024

Since this PR exists, you should keep going with it. Thanks for looking into this!

Signed-off-by: Taym <haddadi.taym@gmail.com>
@Taym95 Taym95 marked this pull request as ready for review August 13, 2024 10:06
audio/context.rs Outdated Show resolved Hide resolved
backends/dummy/lib.rs Outdated Show resolved Hide resolved
backends/gstreamer/lib.rs Outdated Show resolved Hide resolved
servo-media/lib.rs Outdated Show resolved Hide resolved
Signed-off-by: Taym <haddadi.taym@gmail.com>
audio/context.rs Outdated
Self {
.expect("Failed to spawn AudioRenderThread");

let thread_result: Result<(), AudioSinkError> = result_receiver.recv().unwrap();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jdm I think this is blocking now causing the timeout in other test, I am checking it

Signed-off-by: Taym <haddadi.taym@gmail.com>
audio/context.rs Outdated
@@ -156,11 +156,14 @@ impl AudioContext {
})
.expect("Failed to spawn AudioRenderThread");

let thread_result: Result<(), AudioSinkError> = result_receiver.recv().unwrap();
let thread_result = result_receiver.try_recv();
Copy link
Member

@jdm jdm Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work quite right. The recv call is necessary because we need to block until we receive either a success or fail signal on the channel; if we're timing out in tests, it means that we need to find a way to split the work of setting up the audio backend so that we can signal a success before proceeding with running it synchronously.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okey got it, I will revert last commit and try to change how we do the setup.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jdm should we merge this one?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can merge this without fixing the timeout issue you found, and I think the fix needs to be in this repository.

This reverts commit 5c16fdf.

Signed-off-by: Taym <haddadi.taym@gmail.com>
@Taym95 Taym95 force-pushed the fix/handle-audiorenderthread-errors branch from 044d15e to ade1a2a Compare August 14, 2024 10:34
Copy link
Member

@jdm jdm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done!

@jdm jdm enabled auto-merge August 18, 2024 04:44
@jdm jdm added this pull request to the merge queue Aug 18, 2024
Merged via the queue into servo:main with commit ed1d4c7 Aug 18, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants