Try the whole ladder, rather than five eighths of it

MAX_ATTEMPTS was 5 while CANDIDATES was 8, so three ranked candidates were
gathered and then never tried. The cap was arbitrary and the live numbers show
what it cost.

slskd answers 500 whenever it cannot open a connection to a peer, and that is
common: retrying "Michael Jackson - Billie Jean" walked four unreachable peers
before the fifth served it -- succeeding on precisely the last attempt the cap
allowed. "The Weeknd - Die For You" ran the same gauntlet and lost, giving up
with three untried candidates still on the row.

Defaults to CANDIDATES, so the ladder is the ladder. Anyone wanting the old
behaviour can still set MUSE_MAX_ATTEMPTS.

The cap test lowers the value explicitly now; with the two equal by default it
was only ever proving the list ran out, which is the other branch.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Aryan SinghandClaude Opus 5 committed 2026-09-02 11:59:52 -05:00
1 parent baa936e88d
commit 0ebc9515b4
3 files changed
+16 -3

No files matched your search

+1 -1
View File
@@ -561,7 +561,7 @@ stat -c "%h" "/data/media/music/<Artist>/<Album> (<Year>)/<NN> - <Title>.flac"
| `MUSE_MIN_MATCH` | `0.45` | filename-to-track similarity floor |
| `MUSE_TITLE_FLOOR` | `0.5` | the title alone must clear this before the artist counts |
| `MUSE_CANDIDATES` | `8` | ranked candidates kept per request, for fallback |
| `MUSE_MAX_ATTEMPTS` | `5` | peers tried before a request is given up on |
| `MUSE_MAX_ATTEMPTS` | `MUSE_CANDIDATES` | peers tried before a request is given up on |
| `MUSE_ATTEMPT_BACKOFF` | `4` | seconds between candidate attempts |
| `MUSE_SYSTEMIC_LIMIT` | `2` | consecutive connection failures before stopping |
| `MUSE_STALL_MINUTES` | `20` | a transfer moving no bytes for this long is abandoned |