Repository navigation
fix: Fall back from a silent FDv2 synchronizer before data has been received - #237
Draft
kinyoklion wants to merge 1 commit into
Draft
kinyoklion wants to merge 1 commit into
kinyoklion wants to merge 1 commit into
Conversation
…eceived Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@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.
When the SDK has no data yet, it now falls back from an FDv2 synchronizer that sends nothing after 10s, rather than waiting for the 5-minute stream read timeout. This ports launchdarkly/go-server-sdk#461.
FallbackConditionstarts a 10s timer right away, and a change set cancels it. After data is applied, the existing behavior applies unchanged: wait forINTERRUPTED, then wait the 2-minute fallback.dataAppliedis set from the return value ofDataSourceUpdateSinkV2.apply, so a change set the store rejects doesn't count.contract-tests/test-suppressions-fdv2.txt. The file stays because CI references it.v3.2.0-alpha.13, run with long-running tests and nothing suppressed: all tests passed (4890 ran). Before this change,recoverable fallback with recoveryandpermanent fallback with recoveryfailed.Companion CI PR: #236
Implementation details
Requirements
Related issues
launchdarkly/go-server-sdk#461 (same fix in Go).
Describe the solution you've provided
Root cause:
FallbackConditiononly started its timer on anINTERRUPTEDstatus. A synchronizer that accepts the connection but sends nothing reports no status until the read timeout (5 minutes). With two silent synchronizers at the front of the list, initialization ran past the harness's 60s start wait.FDv2DataSourcetracksdataApplied. It has a new constructor overload that takesinitializationFallbackTimeout, used only by tests. The default is 10s.FallbackCondition.Factorytakes the initialization timeout and aBooleanSupplier. Until data has been applied,build()returns a condition whose timer is already running. The old two-argument factory constructor behaves as before.Tests:
FDv2DataSourceFallbackConditionTest: the initialization timer fires without a status; a change set cancels it; the factory uses it only before data has been applied.FDv2DataSourceTest: a silent synchronizer during startup falls back to the next one; a silent synchronizer after data has been applied does not fall back quickly../gradlew test --tests '*FDv2*'passes.Describe alternatives you've considered
Shortening the stream read timeout. Rejected because it would also affect healthy steady-state connections.
Additional context
No public API changes.
Link to Devin session: https://app.devin.ai/sessions/27eec66fcd28426ca483cf5a81b85704
Open in Devin Desktop: https://app.devin.ai/desktop/session/27eec66fcd28426ca483cf5a81b85704?variant=devin
Requested by: @kinyoklion
SDK-3335