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 mpd module hang after suspend #3793

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bretello
Copy link

I've been having this annoying issue for a while, in which after waking up from a long suspend the MPD module is not updating anymore.

Clicking the MPD module icon does trigger play/pause events but it does not show the active song anymore.

I think I finally manage to track it down to a broken idle connection, and this PR fixes the issue.

How to reproduce

Run:

systemctl suspend

go get a beer, come back after a lot of time, and the MPD module will not update anymore.

If you don't have a lot of time, I managed to reproduce similar symptoms by killing the socket(s) using ss:

export MPD_HOST=<mpd host>
export MPD_PORT=<mpd port>
sudo ss -k "dst $MPD_HOST and dport $MPD_PORT" # WARNING: this will kill ALL connections to MPD_HOST:MPD_PORT

The mpd module will not update anymore, even though it responds to clicks.

@@ -50,7 +50,7 @@ inline int close(FILE* fp, pid_t pid) {
ret = waitpid(pid, &stat, WCONTINUED | WUNTRACED);

if (WIFEXITED(stat)) {
spdlog::debug("Cmd exited with code {}", WEXITSTATUS(stat));
spdlog::trace("Cmd exited with code {}", WEXITSTATUS(stat));
Copy link
Author

Choose a reason for hiding this comment

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

I changed this (and below) to trace since they made debugging with -l debug very noisy. I'll be happy to revert this and/or open another PR in case we want separation of concerns.

@bretello bretello marked this pull request as draft November 25, 2024 21:00
@bretello
Copy link
Author

Seems this is not fixing the issue, will keep investigating.

@bretello
Copy link
Author

bretello commented Dec 6, 2024

Update: this seemingly has to to with libmpdclient: running mpc idleloop shows the same problem after a long suspend. It looks like the underlying connection dies but the client never realizes this and keeps waiting for idle events.

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.

1 participant