mirror of
https://github.com/aome510/spotify-player.git
synced 2026-04-26 09:25:49 +03:00
[PR #929] [MERGED] fix: bind CLI socket before spawning handler thread #929
Labels
No labels
bug
documentation
enhancement
good first issue
help wanted
pull-request
question
third-party
third-party
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-player#929
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/aome510/spotify-player/pull/929
Author: @greqor
Created: 2/12/2026
Status: ✅ Merged
Merged: 2/17/2026
Merged by: @aome510
Base:
master← Head:fix/cli-connection-refused-race-condition📝 Commits (1)
30f102bfix: bind CLI socket before spawning handler thread📊 Changes
3 files changed (+29 additions, -13 deletions)
View changed files
📝
spotify_player/src/cli/client.rs(+20 -11)📝
spotify_player/src/cli/handlers.rs(+8 -1)📝
spotify_player/src/main.rs(+1 -1)📄 Description
Fix: CLI "Connection refused" in stateless mode
PR #921 moved the UDP socket binding inside the socket handler function. This introduced a race condition in the stateless CLI path (no running spotify_player instance): the handler thread is spawned but the socket isn't bound yet when the CLI tries to send its request, resulting in "Connection refused (os error 61)".
Fix
The socket handler now accepts an optional pre-bound socket. In the stateless CLI path, the socket is bound before spawning the thread and passed in directly. The TUI/daemon path is unchanged.
Fixes #927
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.