Repository navigation
Conversation
The provider cache is preloaded once when indexstar starts. When a providers backend is unreachable at that moment, the preload fails quietly and /providers keeps returning an empty list until indexstar is restarted, because listing an empty cache never starts a refresh. Before creating the provider cache, fetch the provider list from every providers backend. A backend that fails is retried every SERVER_PCACHE_STARTUP_RETRY_INTERVAL (default 5s), up to SERVER_PCACHE_STARTUP_ATTEMPTS attempts in total (default 5). If any backend still fails, startup fails with an error naming it, so the container exits and is restarted instead of serving incomplete data. The check runs only at startup. Later refresh failures do not stop the server.
Claude reviewThe change does what the description says. Each providers backend is fetched before Findings
claude-sonnet-5-5 at high effort · requested by byo · re-run with |
TakGN
left a comment
There was a problem hiding this comment.
Review findings (7 inline comments). Main concerns: failing the whole process on one bad providers backend, the double fetch that leaves a TOCTOU gap, and sequential probing.
|
@claude review |
Claude reviewThe startup check is correct as written. I read No blockers or should-fix items. Two things the author may want to know, neither worth blocking on:
claude-sonnet-5-5 at high effort · requested by byo · re-run with |
Thanks, both noted. Window before the preload: fixed. The check now hands the lists it fetched to the provider cache. Each source is wrapped so that its first Listeners bound during the check: the indexstar deployment has only a readiness probe ( |
Claude reviewThe startup check looks correct. Failed backends are retried and succeeded ones are fetched once. Each fetched list is handed to the first Limits of this review: the sandbox did not let me run No issues found. claude-sonnet-5-5 at high effort · requested by byo · re-run with |
|
@claude review |
Claude reviewThe change is small and well tested. The retry loop, the clamping of attempts and interval, the per-backend failure reporting and the one-shot Findings
claude-sonnet-5-5 at high effort · requested by byo · re-run with |
|
@claude review |
Claude reviewThe change does what the description says. I found no correctness, concurrency, resource or security problems. I could not read the No issues found. claude-sonnet-5-5 at high effort · requested by byo · re-run with |
Context
Refs #271. When the providers backend is unreachable while indexstar starts, the provider cache preload fails quietly.
GET /providersthen returns an empty list (null) until indexstar is restarted, because listing an empty cache never starts a refresh. On 2026-11-03 this lasted over 40 minutes after an indexer host reboot.Proposed Changes
--providersBackendsbackend. The backends are fetched concurrently.SERVER_PCACHE_STARTUP_RETRY_INTERVAL(default5s, at least1s), up toSERVER_PCACHE_STARTUP_ATTEMPTSattempts in total (default5, at least1). Only failed backends are retried. A backend that answers with an empty list passes, so a new, empty indexer can start.Behavior change for operators: while a providers backend is unreachable, a starting indexstar serves nothing, finds included, instead of serving with an empty provider list. In the worst case a pod takes about 2.5 minutes to exit (5 attempts of up to the 30s HTTP client timeout each, plus 4 waits of 5s), however many backends fail.
Not in this change:
/providersreturningnullfor an empty list.Tests
synctest) for the startup check:pcacheHTTP source: 200 with[],nullor providers passes. 404, 500 and invalid JSON fail and name the backend.runApp:go vet,go test -race ./...andgolangci-lintpass, with no new lint findings.Revert Strategy
Revert the merge commit. No data or config migration is involved; the two new environment variables become unused.
🤖 Assisted by Claude Code