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

Add more locking in mpd module #467

Merged
merged 1 commit into from
Sep 19, 2019
Merged

Conversation

jspngh
Copy link
Contributor

@jspngh jspngh commented Sep 19, 2019

This PR aims to solve issue #281 by taking the connection_lock_ in waitForEvent().

Additionally, I observed that multiple periodic_updaters could be running.
This happens when mpd is playing and no events happen.
This causes the mpd connection to drop when mpd_recv_idle times out.
If the current periodic_updater is sleeping at this moment, update will run and start a new one,
while the current one will also continue running (there is a new connection to mpd at this moment, so it sees no reason to stop). Adding a mutex to make sure update only continues when the current periodic_updater has stopped, fixes this.

It would be nice if more people could try out this code, since I'm not sure #281 is solved by this, maybe it just happens more infrequently.

+ replaced deprecated MPD_IDLE_PLAYLIST with MPD_IDLE_QUEUE
+ add mutex for periodic_updater
@Alexays
Copy link
Owner

Alexays commented Sep 19, 2019

Thank you ❤️ You can tell here if someone had the bug before and doesn't have it anymore :)

@Alexays Alexays merged commit 52db1e8 into Alexays:master Sep 19, 2019
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