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

fix: MPRIS loop tokio::select!() panic on exit #1299

Merged
merged 1 commit into from
Oct 14, 2023

Conversation

ThomasFrans
Copy link
Contributor

This fixes a bug that would cause a panic when quiting the process normally. tokio::select!() was used to await a single branch, which is useless as it can be replaced by a normal await.

closes #1298

This fixes a bug that would cause a panic when quiting the process
normally. `tokio::select!()` was used to await a single branch, which is
useless as it can be replaced by a normal await.
@ThomasFrans
Copy link
Contributor Author

ThomasFrans commented Oct 4, 2023

I'm not 100% sure whether this is the correct way to solve it. I tested MPRIS with this patch and it still works fine. I also tested to make sure the backtrace file wasn't generated anymore. I'm still a bit unsure about how to correctly use async stuff... I think the select!() wasn't necessary as there was only a single await. The documentation for the select!() macro mentions that if the result of the asynchronous task doesn't match the pattern (in this case a None due to the tx being closed), it panics.

@ThomasFrans
Copy link
Contributor Author

OMG I feel stupid... 🤣
#1282 (comment)

@ThomasFrans ThomasFrans mentioned this pull request Oct 12, 2023
@hrkfdn hrkfdn merged commit 8d00ca7 into hrkfdn:main Oct 14, 2023
5 checks passed
@hrkfdn
Copy link
Owner

hrkfdn commented Oct 14, 2023

Huh, you're right, not sure why there was a select! with a single branch.. 🤔 Thanks!

@ThomasFrans ThomasFrans deleted the fix-panic-on-quit branch January 27, 2024 21:30
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.

Backtrace file is created after every process exit
2 participants