Repository navigation
fix: Fall back from a silent FDv2 synchronizer during startup - #402
Draft
kinyoklion wants to merge 1 commit into
Draft
kinyoklion wants to merge 1 commit into
kinyoklion wants to merge 1 commit into
Conversation
Before any data has been applied, a synchronizer that provides no data within 10 seconds is abandoned for the next synchronizer, rather than waiting for the 2 minute interrupted fallback. The FDv2 streaming synchronizer now reports Valid after it applies a changeset, so the synchronizer composite can schedule recovery to the primary synchronizer. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
This branch has not been deployed
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
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.
Requirements
Related issues
The nightly server contract tests (
sdk-server-nightly.yml) have failed on these 3 tests since they were enabled in #380:streaming/fdv2/recoverable fallback to secondary synchronizerstreaming/fdv2/recoverable fallback with recoverystreaming/fdv2/permanent fallback with recoveryThe first one was also hitting a harness bug, which is fixed in launchdarkly/sdk-test-harness#589 (merged). The Go SDK fixed the same SDK-side behavior in go-server-sdk #461.
Describe the solution you've provided
Two changes in the FDv2 data system:
FDv2DataSource.cs). ADataAppliedObserveris added to both the initializer and synchronizer composites, and it records whether any changeset has been applied. When there is more than one synchronizer, each synchronizer'sActionApplierTimedFallbackAndRecoverygets ahasDataBeenAppliedpredicate. If no data has been applied yet, it schedules a 10 second startup fallback (DisposeCurrent/GoToNext/StartCurrent). That timer is cancelled when the source applies data or reportsValidorOff. Before this change, a synchronizer that connected but stayed silent was only abandoned by the 2 minute Interrupted timer. The 2 minute interrupted fallback and the 5 minute recovery are unchanged.FDv2StreamingDataSource.cs). After a changeset is applied successfully, the streaming synchronizer now callsUpdateStatus(Valid), the same way the polling synchronizer and the Go streaming synchronizer do. Before this change,Validwas only produced by the outerDataSourceUpdatesImpl, so the synchronizer composite's action applier never saw it and never scheduled recovery to the primary synchronizer. That is whyrecoverable fallback with recoverystill failed even after the startup fallback was added. It isn't reported when the changeset carries the FDv1 fallback directive, because the source shuts down right after.Describe alternatives you've considered
InitializationTrackerstates. A dedicated observer is simpler, and it doesn't depend on that tracker's state machine.Additional context
Local validation (.NET 8.0.427, net8.0):
StartupFallback*tests inFDv2DataSourceTest, plus updatedFDv2StreamingDataSourceTestexpectations for the newValidstatus.-status-timeout=360 -skip-from=test-supressions-fdv2.txt -enable-long-running-tests, persistence disabled), against a harness that includes sdk-test-harness#589:All tests passed, 5919 run, 11 skipped. The 3 tests above now pass.Points for reviewers:
CompositeSourceignores actions after disposal.Link to Devin session: https://app.devin.ai/sessions/fe4a81e87871412a99d2eed85302fe33
Open in Devin Desktop: https://app.devin.ai/desktop/session/fe4a81e87871412a99d2eed85302fe33?variant=devin