feat: Schedule FDv2 recovery after the FDv1 fallback TTL elapses - #1875
Draft
joker23 wants to merge 1 commit into
Draft
feat: Schedule FDv2 recovery after the FDv1 fallback TTL elapses#1875joker23 wants to merge 1 commit into
joker23 wants to merge 1 commit into
Conversation
A directed FDv1 fallback now always carries a concrete deadline for returning to FDv2. An absent, unparseable, or out-of-range fallback TTL is replaced with a 1-hour default, jittered down by up to half so a fleet that fell back together does not retry in lockstep; a server-supplied in-range TTL is used as given. Fallback is therefore never indefinite. FDv2RecoveryTimer holds that single deadline. It outlives individual synchronizer runs, so the orchestrator races it alongside the active synchronizer and, when every slot is blocked, hands it to a background continuation that restarts the FDv2 sources once the deadline elapses.
Contributor
|
@launchdarkly/js-sdk-common size report |
Contributor
|
@launchdarkly/js-client-sdk size report |
Contributor
|
@launchdarkly/browser size report |
Contributor
|
@launchdarkly/js-client-sdk-common size report |
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.
Summary
Wires the recovery half of the FDv1 fallback directive: once the SDK has fallen back to FDv1, it now schedules an unconditional, elapsed-time attempt to return to FDv2 once the fallback TTL elapses, using the
fdv2Recovery()/isCurrentSynchronizerFDv1Fallbackprimitives added in #1856.Also corrects
fallbackDirective.ts's TTL handling to match the spec: an absent, unparseable, negative, or out-of-range TTL (including0, previously treated as indefinite fallback) now clamps to a jittered 1-hour default instead. A server-supplied in-range TTL is used as-is. Directed fallback is therefore never indefinite.FDv2RecoveryTimeris a new standalone primitive holding that single deadline; it is not modeled as aConditionsincegetConditions()produces nothing when the SDK has one or zero available synchronizers, which is exactly the state a directed fallback creates. InFDv2DataSource, the deadline races the active synchronizer loop, and if every synchronizer slot is blocked before the deadline fires, a background continuation takes over responsibility for the timer and restarts FDv2 sources on its own once it elapses -- without holding up the in-flightstart()/identify()call.This is what #1858's contract-test entity wiring exercises.