Skip to content

v1.6.1: parallel provider search — fixes the very long wait on lyrics finding (#9) - #10

Merged
DynamycSound merged 2 commits into
masterfrom
claude/v0.0.1-release-performance-4uqlzm
Jul 17, 2026
Merged

v1.6.1: parallel provider search — fixes the very long wait on lyrics finding (#9)#10
DynamycSound merged 2 commits into
masterfrom
claude/v0.0.1-release-performance-4uqlzm

Conversation

@DynamycSound

Copy link
Copy Markdown
Owner

Fixes #9 — lyrics search could take ~10 minutes when a song was only available on a provider late in the chain (e.g. QQ Music), because providers were tried strictly one after another, each stacking retries and 20s network timeouts before the next one even started.

What changed

All providers are queried at the same time

SmartLyricsMatcher.search now fans out one concurrent job per enabled provider. Requests within one provider stay sequential with the polite inter-request delay, so per-provider rate limiting is completely unchanged — only the waiting overlaps. Total search time is now roughly the fastest provider that has the lyrics, not the sum of every slow one before it.

Priority order and early stop preserved

Results are collected in the user's configured provider order (Settings → Provider order), so the same match wins as before when several providers find the song. The auto-accept early stop still works: once the chain-so-far holds an auto-accept hit, lower-priority providers still in flight are cancelled (already-finished ones are merged for free as extra manual-search suggestions). Cancelled providers are reported via a new onSkipped callback so the per-provider dropdown shows them as untried, not failed.

Hard time budget per provider

Each provider gets a 25s wall-clock budget (MatchConfig.providerTimeoutMs) — a hung host is skipped instead of stalling the search. The same budget now bounds the plain-lyrics fallback and the last-resort rescue, which run after a failed search and could otherwise re-create the long wait.

Faster retries and tighter network timeouts

  • Retry backoff starts at 500ms instead of 1s (still exponential with jitter).
  • Ktor timeouts tightened: 12s request / 6s connect / 12s socket (were 20/10/20).

Last-resort rescue parallelized too

Its cleaned queries now run concurrently (each with its own budget, partial results still scored on timeout), and LastResortAPI.canonicalize queries iTunes and Deezer simultaneously instead of back-to-back.

Release

  • Version bump 1.6.0 → 1.6.1 (versionCode 161) — a patch release.
  • RELEASE_NOTES.md rewritten for v1.6.1; CI publishes the signed APK release automatically from the version bump.

Testing

  • :app:compileDebugKotlin and the full JVM unit test suite (:app:testDebugUnitTest) pass — 70 tests. Two live-network LRCLib tests flaked under rate-limiting when the whole suite ran back-to-back and pass in isolation (the documented procedure in their own header comment).
  • The live LastResortMatchTest confirms the parallelized rescue path still rescues garbled filenames end-to-end against real providers.

🤖 Generated with Claude Code

https://claude.ai/code/session_01E85xwceLkGtvj5E2qiYTDd


Generated by Claude Code

claude added 2 commits July 17, 2026 12:20
#9)

Lyrics search could take ~10 minutes when a song was only available on a
provider late in the chain: providers were tried strictly sequentially, each
stacking retries and 20s network timeouts before the next one even started.

- SmartLyricsMatcher.search now fans out to every enabled provider
  concurrently; requests within one provider stay sequential and politely
  delayed, so per-provider rate limiting is unchanged.
- Results are collected in the user's configured priority order, keeping the
  old auto-accept early-stop semantics; providers cancelled mid-flight are
  reported via onSkipped so the UI shows them as untried, not failed.
- Hard 25s wall-clock budget per provider (and for the plain-lyrics and
  last-resort fallbacks) so a hung host can never stall the search.
- Faster retry backoff (500ms base) and tighter Ktor timeouts
  (12s request / 6s connect).
- Version bump 1.6.0 -> 1.6.1 (versionCode 161) + release notes.

Fixes #9

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E85xwceLkGtvj5E2qiYTDd
…calize

The rescue path walked its cleaned queries and both canonicalize endpoints
strictly sequentially, so slow hosts stacked up inside the new per-provider
time budget and could leave it with nothing to score. Each query now runs
concurrently with its own budget (partial results are still scored on
timeout), and iTunes/Deezer are queried simultaneously.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E85xwceLkGtvj5E2qiYTDd
@DynamycSound
DynamycSound merged commit f8001dd into master Jul 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: very long wait on lyrics finding

2 participants