Commit 812c972
fix: handle dealer reconnect in-place without restarting spirc
Symptoms observed in logs:
WARN librespot_core::dealer Websocket peer does not respond.
WARN librespot_connect::spirc unexpected shutdown
WARN librespot Spirc shut down unexpectedly
When the dealer websocket drops (peer timeout or TLS close_notify),
SpircTask broke out of its event loop so main.rs could tear down and
recreate the entire Spirc. This caused playback to stop on every
transient websocket drop — even though the dealer already
auto-reconnects the websocket.
The subscription streams survive reconnects because they are registered
on the shared DealerShared instance. After reconnect, the server pushes
a new connection_id which handle_connection_id_update already handles.
Changes: reconnect_rx.changed() logs and continues instead of breaking.
handle_connection_id_update errors are non-fatal (logged, not breaking).
After fix — 6 days of logs (Mar 14-20) showing ~20 dealer reconnects
handled in-place without restarting spirc or stopping playback:
Mar 16 05:06 — "Dealer reconnected; awaiting new connection_id."
Mar 16 05:06 — "re-registering with active playback state: Paused { ... }"
[no restart, no "Spirc shut down unexpectedly"]
Mar 18 12:14 — "Dealer reconnected; awaiting new connection_id."
Mar 18 12:14 — "re-registering with active playback state: Playing { ... }"
[playback continued uninterrupted]
Mar 19 — 9 dealer reconnects in one day, all handled in-place
Summary: 0 spirc restarts from dealer reconnects (vs ~1/day before fix).
Co-authored-by: Copilot <[email protected]>1 parent 34d2fd9 commit 812c972
1 file changed
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
480 | 480 | | |
481 | 481 | | |
482 | 482 | | |
483 | | - | |
484 | 483 | | |
485 | 484 | | |
486 | 485 | | |
| |||
588 | 587 | | |
589 | 588 | | |
590 | 589 | | |
591 | | - | |
592 | | - | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
593 | 595 | | |
594 | | - | |
595 | | - | |
| 596 | + | |
596 | 597 | | |
597 | 598 | | |
598 | 599 | | |
| |||
0 commit comments