-
Notifications
You must be signed in to change notification settings - Fork 45
feat(experimental): Release EAP support for FDv2 data system #375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- CURSOR_SUMMARY --> > [!NOTE] > Introduces FDv2 data system configuration and robust synchronizer lifecycle (start/stop), integrates SSE streaming with payload filter, implements an in-memory feature store, and updates tests and contract client accordingly. > > - **FDv2/Data System**: > - Add `Synchronizer.stop()` to interface and implement stop/lifecycle management in `StreamingDataSource` and `PollingDataSource`. > - Enhance `FDv2` to track/stop the active synchronizer safely with locks; ensure threads shut down cleanly. > - Add `datasystem.config` builders (`polling_ds_builder`, `streaming_ds_builder`), expose `fdv1_fallback_synchronizer` in config. > - **Streaming**: > - Switch to `ld_eventsource.SSEClient`; include payload filter in stream URI. > - Handle stream errors by interrupting/closing SSE; stop on unrecoverable errors; ensure closure on exit. > - **Polling**: > - Add stoppable sync loop with `_stop` flag and `stop()` method. > - **Store**: > - Implement thread-safe `InMemoryFeatureStore` with basic CRUD, init, and diagnostics; integrate with `Store`. > - **Contract tests**: > - Support FDv2 `dataSystem` config (initializers/synchronizers, payloadFilter) in `client_entity.py`. > - **Tests**: > - Update streaming synchronizer tests for new SSE client usage and stop/interrupt behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit e87daa0. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
In the previous setup, we would only check the fallback or recovery conditions once the synchronizer returned an update. If the synchronizer was stuck, or nothing was changing in the environment, we would never check the conditions. This configuration also exposed an interesting behavior. If the synchronizer cannot connect, it will emit error updates. Each time we receive an error, we check if we have failed to initialize for the last 10 seconds. If so, we re-create the primary synchronizer. When it continues to fail, the first update will trigger the condition check. And since it has still failed for 10 seconds, it will immediately error out. With this change, we can be assured a synchronizer is given at least 10 seconds to try before the condition is evaluated.
kinyoklion
approved these changes
Nov 19, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note
Introduces an experimental FDv2 data system (streaming/polling) with persistent-store support and FDv1 fallback, updates LDClient to use it when configured, adds v2 file/test data sources, and adjusts tests/CI/deps.
ldclient.impl.datasystem.fdv2with orchestrated initializers/synchronizers, status providers, data availability, and persistent-store integration (read-only/read-write) with outage recovery andcommit.LDClientnow selects FDv2 whenConfig.datasystem_configis provided and evaluates viaReadOnlyStore; readiness usesDataAvailability.ldclient/datasystem.pyandldclient/config.py(DataSystemConfig, builders for default/streaming/polling/custom, FDv1 fallback).ldclient.impl.datasourcev2.streaming(SSE, selector/basis support, diagnostics, env-id and fallback headers).ldclient.impl.datasourcev2.polling(FDv2/FDv1 payload parsing, ETag/304, env-id/fallback handling).ldclient.impl.datasystem.store(in-memory + optional persistence, change tracking, dependency propagation).Files.new_data_source_v2and test data sourceintegrations.test_datav2implementing Initializer/Synchronizer.contract-tests/client_entity.pyextended to configure data system (initializers/synchronizers, fallback, payload filter).ldclient.interfaces: Initializer/Synchronizer,Selector,ChangeSet/Change,Basis,Update,DataStoreMode,ReadOnlyStore, and moved protocol event types.ldclient/client.py: wiring toDataSystem, store access via_data_system.store, readiness viadata_availability, diagnostics pass-through.LD_SKIP_FLAKY_TESTS; Makefile creates.mypy_cache.launchdarkly-eventsourceto>=1.5.0, updatepytestto^8.0.0.Written by Cursor Bugbot for commit 23dae3d. This will update automatically on new commits. Configure here.