You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When librespot can't play any track on an account (the error audio key 0 1 block, librespot-org/librespot#1649), the stampede guard from #282 doesn't stop playback. It pauses after 3 consecutive Unavailable events, but librespot keeps loading the next track, so it still runs through the whole queue at machine speed. In a user's log it went to 17 failed tracks in 43 seconds with no input in spotatui, and CDN file loads started failing with rate limited. In a second session it went to 42 failures and Spirc state updates got 429 Too Many Requests. It only stopped when the queue ran out.
Cause
Spirc answers every PlayerEvent::Unavailable with handle_next (the Unavailable arm in connect/src/spirc.rs), and handle_unavailable also preloads the next track. A paused load_track still requests the audio key and the file, so the Pause the guard sends (UNAVAILABLE_ESCALATION_THRESHOLD in src/infra/player/events.rs) doesn't break the loop. DeferredPlayerCommand::Stop wouldn't either as written: it only calls player.stop() and leaves Spirc's state alone.
Every track logs error audio key 0 1 then Skipping to next track, and the consecutive N count in native playback unavailable keeps climbing past 3.
[17:59:16][spotatui::infra::player::events][INFO] native playback unavailable (track spotify:track:1JbrVh45evNhbm3R75aYzg, consecutive 3)
[17:59:16][spotatui_librespot_playback::player][INFO] Loading <I Really Want to Stay at Your House> with Spotify URI <spotify:track:7mykoq6R3BArsSpNDjFQTm>
[17:59:16][spotatui_librespot_core::audio_key][ERROR] error audio key 0 1
...
[17:59:35][spotatui_librespot_playback::player][ERROR] Unable to load encrypted file: Error { kind: ResourceExhausted, error: "rate limited for at least another 0 seconds" }
...
[17:59:55][spotatui::infra::player::events][INFO] native playback unavailable (track spotify:track:1Qtoq02RTZ4alrR7vJ4Lai, consecutive 17)
Expected behavior
After 3 consecutive unavailable tracks, native playback stops and no more keys or files are requested until the user starts something again.
Screenshots
N/A, log excerpt above.
Desktop (please complete the following information):
OS: any
Terminal: any
Version: 0.42.0 (spotatui-librespot 0.8.3)
Additional context
The account-side key block is upstream and can't be fixed here. This issue is only about the guard. The fix probably belongs in the fork, either stopping Spirc's auto-advance after N consecutive unavailable tracks or exposing a Spirc stop the guard can call. The fork has issues disabled, so this one tracks it.
Describe the bug
When librespot can't play any track on an account (the
error audio key 0 1block, librespot-org/librespot#1649), the stampede guard from #282 doesn't stop playback. It pauses after 3 consecutiveUnavailableevents, but librespot keeps loading the next track, so it still runs through the whole queue at machine speed. In a user's log it went to 17 failed tracks in 43 seconds with no input in spotatui, and CDN file loads started failing withrate limited. In a second session it went to 42 failures and Spirc state updates got429 Too Many Requests. It only stopped when the queue ran out.Cause
Spirc answers every
PlayerEvent::Unavailablewithhandle_next(theUnavailablearm inconnect/src/spirc.rs), andhandle_unavailablealso preloads the next track. A pausedload_trackstill requests the audio key and the file, so thePausethe guard sends (UNAVAILABLE_ESCALATION_THRESHOLDinsrc/infra/player/events.rs) doesn't break the loop.DeferredPlayerCommand::Stopwouldn't either as written: it only callsplayer.stop()and leaves Spirc's state alone.To Reproduce
error audio key 0 1thenSkipping to next track, and theconsecutive Ncount innative playback unavailablekeeps climbing past 3.Expected behavior
After 3 consecutive unavailable tracks, native playback stops and no more keys or files are requested until the user starts something again.
Screenshots
N/A, log excerpt above.
Desktop (please complete the following information):
spotatui-librespot0.8.3)Additional context
The account-side key block is upstream and can't be fixed here. This issue is only about the guard. The fix probably belongs in the fork, either stopping Spirc's auto-advance after N consecutive unavailable tracks or exposing a Spirc stop the guard can call. The fork has issues disabled, so this one tracks it.