spotify / spotify/confidence-resolver
Rust local provider should bound and recover from initial CDN state fetch failures
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16
- Forks
- 14
- Avg merge
- 2d 7m
- Merged PRs (30d)
- 40
Description
Problem
The Rust local provider exposes ProviderOptions::initialize_timeout, but the option is not applied. Its default reqwest client has no total, connect, or read timeout configured. The initial CDN fetch can therefore wait indefinitely. If it returns an error, initialization sets the provider to Error before background polling is started, so recovery requires recreating or reinitializing the provider.
The README also describes a 30 second default initialization timeout that the implementation does not provide.
Intended behavior
Match the Java local provider startup behavior:
- Apply a bounded initialization/state-fetch timeout, defaulting to 30 seconds, and honor
initialize_timeout. - Initialization should leave the provider
NotReady, rather than permanentlyError, when initial CDN state is unavailable. - Flag evaluations should return the caller supplied default with
ProviderNotReady. - Start a background retry loop even when the initial fetch fails.
- Retry every 1 second while
NotReady. - After a successful fetch, transition to
Readyand use the configured normal polling interval. - Shutdown must cancel in-flight fetches and retry tasks.
- Once initialized, preserve the last good state during later CDN failures.
Acceptance criteria
- The configured initialization timeout is actually enforced.
- Startup cannot hang indefinitely on the CDN request.
- Recovery happens automatically without recreating the provider.
- Tests cover timeout, repeated retry, recovery to
Ready, default-value evaluation whileNotReady, and shutdown cancellation. - README examples use the actual
DurationAPI and accurately describe timeout behavior.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Rust local provider implementation and trace ProviderOptions::initialize_timeout through the initial CDN state fetch, provider state transitions, polling, evaluation, and shutdown. Use the acceptance criteria to define tests for timeout, retries, recovery, default-value evaluation, and cancellation. Then update the README examples and timeout description to match the actual Duration API and behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100