Summary
WikipediaSearcher (backend/integrations/wikipedia/utils.py) has no retry/backoff on its Wikipedia API calls, and — worse — it caches transient failures as permanent "no result" for 7 days.
In search_wikipedia():
The page-fetch path (verify_wikipedia_reference) is the same shape: non-200 / exception → treated as "not a valid page."
Impact
A momentary Wikipedia hiccup (timeout, 429, 503, transient network error) during a bulk run is indistinguishable from "this performer has no Wikipedia page." The empty result is then cached for 7 days, so a performer who does have an article is silently skipped on every subsequent run until the cache expires or someone passes --force-refresh.
This surfaced while bulk-running scripts/verify_performer_references.py --reftype wikipedia --onlynew over ~31k performers — exactly the scenario where transient errors are most likely and most damaging.
Proposal
- Add retry + exponential backoff on 503/429/timeout/connection errors, mirroring the MusicBrainz client (
integrations/musicbrainz/client.py:685-692).
- Distinguish "no result" from "request failed." Only cache an empty result when the API genuinely returned no match (HTTP 200, empty list). On a transient error, return
None without poisoning the cache, so a later run retries.
Acceptance criteria
Summary
WikipediaSearcher(backend/integrations/wikipedia/utils.py) has no retry/backoff on its Wikipedia API calls, and — worse — it caches transient failures as permanent "no result" for 7 days.In
search_wikipedia():return None(utils.py:637-638).return None(utils.py:688-689).The page-fetch path (
verify_wikipedia_reference) is the same shape: non-200 / exception → treated as "not a valid page."Impact
A momentary Wikipedia hiccup (timeout, 429, 503, transient network error) during a bulk run is indistinguishable from "this performer has no Wikipedia page." The empty result is then cached for 7 days, so a performer who does have an article is silently skipped on every subsequent run until the cache expires or someone passes
--force-refresh.This surfaced while bulk-running
scripts/verify_performer_references.py --reftype wikipedia --onlynewover ~31k performers — exactly the scenario where transient errors are most likely and most damaging.Proposal
integrations/musicbrainz/client.py:685-692).Nonewithout poisoning the cache, so a later run retries.Acceptance criteria