Repository navigation
Conversation
Co-Authored-By: Bee Klimt <bklimt@launchdarkly.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.
Makes the FDv2 data system's FDv1 fallback TTL-based, so the SDK always recovers to FDv2, per sdk-specs#251 (DATASYSTEM v2 1.6 / CSFDV2 8.3).
Related issues
SDK-2990 (part of SDK-2935). Reference: cpp-sdks#631.
Describe the solution you've provided
X-LD-FD-Fallback-TTLheader (streaming and polling, synchronizers and initializer) or fromgoodbye.protocolFallbackTTL. A streaming goodbye that carriesprotocolFallbackTTLnow triggers fallback.@synchronizer_builders. The FDv1 synchronizer runs until the TTL elapses, then it is stopped and FDv2 restarts from the primary synchronizer.INTERRUPTEDinstead of halting withOFF, releases ready waiters, and retries FDv2 after the TTL.consume_synchronizer_results'sensure) before the next one is built, so FDv1 and FDv2 never write concurrently.Implementation details
LaunchDarkly::Impl::DataSystem.fdv1_fallback_ttl/.fdv1_fallback_ttl_from_headers(inpolling.rb, next tofdv1_fallback_requested?) do the TTL normalization.UpdateandFetchResultgain an optionalfdv1_fallback_ttl.FDv2normalizes again, so a custom source that leaves itnilgets the jittered default.FDv2#run_fdv1_fallback(ttl)runs the FDv1 synchronizer.consume_synchronizer_resultstakes a newrecover_after:argument, which schedules a one-shot"recover"action that returnsSyncResult::RECOVER. If FDv1 fails permanently, or no FDv1 synchronizer is configured, it waits on@stop_eventfor the rest of the TTL.Deliberately unchanged:
OFFif none is configured), because there is no FDv2 synchronizer to recover to.goodbyetoday. Polling fallback still comes from the response headers.sleep 1.0negative assertion. Only its name and comment were updated.fdv1-fallbackcapability is already advertised, and the scenarios live in the shared harness.Testing:
bundle exec rspec spec(1263 examples, 0 failures) andbundle exec rubocop(no offenses). New specs cover valid TTLs unchanged, invalid TTLs in [1800, 3600], jitter bounds, header and goodbye TTL propagation, recovery without an FDv1 synchronizer, and FDv1 being stopped before FDv2 restarts.Describe alternatives you've considered
Clamping out-of-range TTLs to 3600 instead of defaulting them. Rejected because the spec says to use the jittered default.
Additional context
The requirements checklist above is left for the author to tick.
Link to Devin session: https://app.devin.ai/sessions/e2ff05b34a7b46deb8f5d82653515590
Open in Devin Desktop: https://app.devin.ai/desktop/session/e2ff05b34a7b46deb8f5d82653515590?variant=devin
Requested by: @beekld