FlagsmithClient should support deterministic shutdown of local-evaluation polling
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 52/100
Línea de trabajo
Comienza leyendo FlagsmithClient.cs y PollingManager.cs, centrándote en el finalizador, el temporizador de polling, el callback y la limpieza actual de StopPoll. Implementa un apagado determinista e idempotente que detenga el polling, impida solicitudes futuras, gestione los refreshes en curso cuando sea posible y preserve la seguridad del finalizador; verifica el comportamiento con la reproducción descrita en el issue.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
In Flagsmith .NET SDK 9.0.0, enabling local evaluation starts a PollingManager backed by System.Threading.Timer.
The only cleanup currently occurs in the FlagsmithClient finalizer:
~FlagsmithClient() => _pollingManager?.StopPoll();
This does not provide deterministic cleanup when an application host or dependency-injection container stops. Additionally, the timer callback retains the polling manager, whose callback retains the client. This may keep the client reachable and prevent its finalizer from running.
Relevant source:
- https://github.com/Flagsmith/flagsmith-dotnet-client/blob/fc8f50f2004363c951d3c64dcd04d8ffd3cc0c87/Flagsmith.FlagsmithClient/FlagsmithClient.cs
- https://github.com/Flagsmith/flagsmith-dotnet-client/blob/fc8f50f2004363c951d3c64dcd04d8ffd3cc0c87/Flagsmith.FlagsmithClient/PollingManager.cs
Impact
In long-running processes that create and stop application hosts:
- Environment-document requests can continue after the host stops.
- Recreated hosts and tests can accumulate polling timers.
- References to clients, loggers, and related services can remain alive.
- Consumers cannot bind polling cleanup to their application lifecycle.
Process termination masks the issue because the operating system removes the timer.
Reproduction
- Configure
FlagsmithClientwith local evaluation and a short refresh interval. - Point it at an HTTP handler that counts environment-document requests.
- Create the client and observe polling.
- Stop or dispose the owning host or service provider without terminating the process.
- Wait beyond the refresh interval.
- Environment-document requests continue because there is no public shutdown or disposal API.
Expected behaviour
FlagsmithClient should expose deterministic cleanup, for example through IDisposable, IAsyncDisposable, or an explicit shutdown method.
Cleanup should:
- Stop and dispose the polling timer immediately.
- Prevent future environment-document requests.
- Cancel an in-flight refresh where possible.
- Be idempotent.
- Call
GC.SuppressFinalizeif a finalizer remains as a fallback.
This would allow integrations such as OpenFeature providers to stop polling from their normal host shutdown lifecycle.
- Lenguaje dominante
- C#
- Estrellas
- 20
- Forks
- 17
- Merge medio
- 21 h 47 min
- PR fusionados (30 d)
- 8
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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-dotnet-client
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Flagsmith/flagsmith-dotnet-client#197 ·
Los mantenedores suelen responder en 1 día
-
Dependency DashboardAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Flagsmith/flagsmith-dotnet-client#194 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
Flagsmith/flagsmith-dotnet-client#190 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Local evaluation silently drops identity overrides on large environmentsPosiblemente ocupada @marc-merino la tomó hace 38 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Flagsmith/flagsmith-dotnet-client#187 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
Flagsmith/flagsmith-dotnet-client#180 ·
Los mantenedores suelen responder en 1 día
Todos los issues de Flagsmith/flagsmith-dotnet-client
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Natvs/Nt.Automaton#33 ·
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
a-corriger documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
christian-raj/S-Aloha#312 ·
-
ready-for-agent tech-debt
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
DigiBanks99/menlo#640 ·
Los mantenedores suelen responder en 1 día
-
ci
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
OpenTabletDriver/OpenTabletDriver#5283 ·
Los mantenedores suelen responder en 3 días