Support a Client Readiness check in local evaluation mode
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 45/100
Línea de trabajo
Comienza en flagsmith/flagsmith.py alrededor del fallback remoto en las líneas 252-259 y, a continuación, sigue la inicialización, el modo de evaluación local y get_environment_flags/get_identity_flags. Define y prueba el estado de disponibilidad y asegúrate de que la ausencia de un documento de entorno en el modo local devuelva las flags predeterminadas sin llamadas remotas en cada evaluación, mientras el sondeador en segundo plano puede recuperarse.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 24
- Forks
- 12
- Merge medio
- 15 h 43 min
- PR fusionados (30 d)
- 4
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Flagsmith/flagsmith-python-client
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
-
Dependency Dashboard Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
-
Flagsmith/flagsmith-python-client#198 · 1 comentario · 2 asignados ·
Todos los issues de Flagsmith/flagsmith-python-client
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100