Support a Client Readiness check in local evaluation mode
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 45/100
Piste de recherche
Commencez dans flagsmith/flagsmith.py autour du fallback distant aux lignes 252-259, puis suivez l’initialisation, le mode d’évaluation local et get_environment_flags/get_identity_flags. Définissez et testez l’état de disponibilité, et assurez-vous que l’absence d’un document d’environnement en mode local renvoie les flags par défaut sans appels distants à chaque évaluation, tandis que le poller en arrière-plan peut récupérer.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Python
- Étoiles
- 24
- Forks
- 12
- Merge moyen
- 15 h 43 min
- PR mergées (30 j)
- 4
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de Flagsmith/flagsmith-python-client
-
Difficulté 3/5 1-2 jours Accessibilité débutants 68/100
-
Difficulté 3/5 1-2 jours Accessibilité débutants 65/100
-
Dependency Dashboard Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
-
Difficulté 3/5 1-2 jours Accessibilité débutants 68/100
-
Flagsmith/flagsmith-python-client#198 · 1 commentaire · 2 personnes assignées ·
Toutes les issues de Flagsmith/flagsmith-python-client
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100