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 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 FDv1 fallback directive TTL-based and never terminal, per the SDK-2527 spec change (sdk-specs#251, DATASYSTEM v2 1.6 / CSFDV2 8.3).
Closes SDK-2989. Part of SDK-2935. Mirrors cpp-sdks#631.
X-LD-FD-Fallback-TTLorgoodbye.protocolFallbackTTL(seconds). Values in (0, 3600] are used as-is. Missing, malformed, zero, negative, or > 3600 gives the 1 hour default minus uniform [0, 1800]s of jitter.protocolFallbackTTLnow acts as a fallback directive, on both streaming and polling.FDv2/AsyncFDv2keep the FDv2 synchronizer list, run FDv1 (if configured) for the TTL, then restart FDv2 from the first synchronizer.Requirements
async_*siblings (or N/A)Implementation details
Describe the solution you've provided
ldclient/impl/util.py:fdv1_fallback_ttl()applies the TTL rules.fdv1_fallback_ttl_from_headers()reads both headers.UpdateandBasisgain an optionalfallback_ttl.Goodbyegainsprotocol_fallback_ttl.protocolFallbackTTLemits an INTERRUPTED update withfallback_to_fdv1=Trueand halts the stream. A goodbye without it is still just logged.with_goodbye_fallback()turns an in-band goodbye TTL into the same headers the existing fallback path already reads. A goodbye-only payload is no longer an error (it returns no changes)._run_fdv1_fallback()runs the FDv1 synchronizer until the TTL expires, using a one-shot recovery timer in_consume_synchronizer_results, or just waits on the stop event when no FDv1 synchronizer is configured. Store writes still happen only on the coordinator thread/task, and each synchronizer is stopped before the next one starts, so FDv1 and FDv2 never write concurrently.Describe alternatives you've considered
(ChangeSet, headers)result instead of folding it into headers. That would have changed every polling requester and the test mocks that build those tuples.Additional context
"1.5"gets the default). Recovery restarts all configured FDv2 synchronizers, including any that were removed after a permanent failure before the fallback.make lintpasses, and so does the fullpytestrun withLD_SKIP_DATABASE_TESTS=1.Link to Devin session: https://app.devin.ai/sessions/1439eb6230bf40f1bb73a3fd22612165
Open in Devin Desktop: https://app.devin.ai/desktop/session/1439eb6230bf40f1bb73a3fd22612165?variant=devin
Requested by: @beekld