Skip to content

Fall back when the server lookup never answers - #1598

Merged
frenck merged 1 commit into
mainfrom
frenck/dns-lookup-timeout
Oct 2, 2026
Merged

frenck merged 1 commit into
mainfrom
frenck/dns-lookup-timeout

Conversation

@frenck

@frenck frenck commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Breaking change

None.

Proposed change

Some routers silently drop SRV queries instead of refusing them. The lookup of _api._tcp.radio-browser.info then never answers, and the request timeout cut every attempt short before the lookup could fail. The client never reached the fallback host, so on such a network every call failed.

The lookup now gets half of the request timeout. When it runs out, the client logs it and falls back to all.api.radio-browser.info, the same as when the lookup fails outright. The resolver is still closed when the lookup is cut short, so the crash fixed in #1592 stays fixed.

Found in the fourth review round.

Type of change

  • Dependency or tooling upgrade
  • Bugfix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Deprecation (replaces or removes a feature, with a migration path)
  • Breaking change (a fix or feature that changes existing behavior)
  • Code quality, refactor, or test-only change
  • Documentation only

Additional information

  • This PR fixes or closes issue: fixes # None
  • This PR is related to: None
  • Link to a separate documentation pull request: None

Checklist

  • I fully understand the code in this pull request and can explain every line, including any AI-assisted changes.
  • The change is covered by tests, and poetry run pytest passes locally. A pull request cannot be merged unless CI is green.
  • poetry run prek run --all-files passes (lint, format, and type checks).
  • No commented-out or dead code is left in the pull request.

Some routers silently drop SRV queries instead of refusing them. The
request timeout then cut every lookup short before it could fail, so the
client never reached the fallback host. Give the lookup half of the
request timeout, and fall back to all.api.radio-browser.info when it runs
out.
@frenck frenck added the bugfix Inconsistencies or issues which will cause a problem for users or implementers. label Oct 2, 2026
@frenck
frenck merged commit d4135cc into main Oct 2, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Inconsistencies or issues which will cause a problem for users or implementers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant