mainloop: don't panic when discovery stops without credentials - #1424
Open
Hayao0819 wants to merge 1 commit into
Open
mainloop: don't panic when discovery stops without credentials#1424Hayao0819 wants to merge 1 commit into
Hayao0819 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
spotifydpanics with a bareOption::unwrap()when the zeroconf responder fails to come up. My service sat in a systemd restart loop with nothing but this in the journal:The cause was
net.ipv4.igmp_max_memberships, default 20, against the 27 interfaces carrying addresses on this box (docker, tailscale, a pile of emulator taps). libmdns gives up joining the multicast group, and spotifyd dies two lines later:(
:52is current master,:244is the same code in 0.4.1.)librespot does report the failure, we just never see it.
launch_libmdnslogs it and pushes it into the event channel (discovery/src/lib.rs#L418-L421):The
Streamimpl then turns that into end-of-stream, sinceItemisCredentialsand there's nowhere to put an error (discovery/src/lib.rs#L539-L553):All of it happens inside
spawn_blocking, long afterlaunch()handed us anOk, so the retry loop insetup.rsnever gets a chance either.Nonehere means "no credentials, ever", not "shutting down". Handling it gives:Only a discovery-only start with no cached credentials reaches that branch. With credentials present,
get_credentialstakes the non-blocking arm and behaves as before.