spotify / spotify/confidence-resolver

JS local provider should recover after initial CDN state fetch failure

Open
#602 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
16
Forks
14
Avg merge
2d 7m
Merged PRs (30d)
40

Description

Problem

The JavaScript local provider retries CDN state requests during initialization, but the retries are bounded by initializeTimeout (30 seconds by default). If no state is fetched before that deadline, initialize() rejects, the provider enters ERROR, and the background state-refresh scheduler is never started.

A transient CDN outage at process startup therefore requires application-level reinitialization or a restart.

Intended behavior

Match the Java local provider startup behavior:

  • Initialization should return without waiting indefinitely for CDN state.
  • The provider should remain NOT_READY while no valid state is available.
  • Flag evaluations should return the caller supplied default with a provider-not-ready error.
  • A background task should retry state fetching every 1 second while NOT_READY.
  • After valid state is loaded, transition to READY and use the configured normal state update interval.
  • Closing the provider must cancel in-flight requests and retry scheduling.
  • Preserve the existing retry handling for transient network errors, 408, 429, and 5xx responses.

Acceptance criteria

  • A startup CDN outage does not cause permanent ERROR state.
  • Recovery happens automatically without calling initialize() again.
  • Tests cover an unreachable CDN, repeated retry, recovery to READY, default-value evaluation while NOT_READY, and shutdown cancellation.
  • Existing behavior after a state has already been loaded remains unchanged.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the JavaScript local provider's initialize(), state-refresh scheduler, flag-evaluation path, and close() handling; compare startup behavior with the Java local provider. Add tests for an unreachable CDN, repeated retries, recovery to READY, default-value evaluation while NOT_READY, and shutdown cancellation, then verify existing post-load behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, javascript
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.