Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Support a Client Readiness check in local evaluation mode

Aperta
#197 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Inizia in flagsmith/flagsmith.py intorno al fallback remoto alle righe 252-259, quindi segui l’inizializzazione, la modalità di valutazione locale e get_environment_flags/get_identity_flags. Definisci e testa lo stato di readiness e assicurati che un documento di ambiente mancante in modalità locale restituisca i flag predefiniti senza chiamate remote a ogni valutazione, mentre il poller in background può recuperare.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem
Currently, when a Flagsmith client is initialized, it makes a blocking remote call to the Flagsmith endpoint to fetch the environment document. If this fetch fails, the exception is simply logged with an error message.

The issue arises during subsequent flag evaluations (get_environment_flags / get_identity_flags). If the initial fetch failed, the SDK defaults to fetching the flags via a remote API call.

This behavior is highly undesirable when the client is explicitly configured for local evaluation mode.

Systemic Impact
If the client is unable to fetch the environment document because the Flagsmith edge/proxy is experiencing high load or degradation, the default API fallback mechanism drastically worsens the situation. Instead of polling for the document occasionally, the client begins making a remote API call for every single flag evaluation. This creates a thundering herd effect, overwhelming the proxy and potentially causing a death spiral where the proxy can never recover to a healthy state. Also, now clients are no longer evaluating flags locally resulting in latencies in the call path.

Proposed Solution
We need a way to verify the client's state and prevent unwanted remote API spam.

Introduce a ready() API: The SDK should expose a ready() method (or an is_ready property) that developers can use to check for client readiness before proceeding with flag evaluations in the evaluation path.

Re-evaluate the Fallback Behavior: When in local evaluation mode, the SDK should ideally not fall back to remote API calls on a per-evaluation basis if the environment document is missing. Instead, it should return default flags and rely on the background poller to eventually fetch the document once the proxy recovers.

Expected Behavior
In local evaluation mode, a failure to fetch the initial environment document should not silently convert the client into a remote-evaluation client. Developers should be able to check if the local cache is populated and healthy via a ready() method.

Lingua principale
Python
Stelle
24
Fork
12
Merge medio
15h 43m
PR unite (30g)
4

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Flagsmith/flagsmith-python-client

Tutte le issue di Flagsmith/flagsmith-python-client

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.