Repository navigation
Conversation
…en its payload has a selector
f6af197 to
c2788f3
Compare
…essful connection
…ps the stream open
…the data source has not already failed
…nd remove duplicates
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 843447f. Configure here.
There was a problem hiding this comment.
Risk: medium.
Automated risk review (dry run): Medium
This PR would not be automatically approved. Human approval required.
Why: This reworks FDv2 synchronizer parking, retry, fallback TTL, and the public FDv2SourceResult API in FDv2DataSource, SourceManager, and related synchronizers. Cursor Bugbot also reported an unresolved medium-severity issue in FDv2StreamingSynchronizer where a failed ping poll can be overwritten by the reset-threshold timer.
If you disagree with this review, share this PR in #feedback-agent-approvals or submit a changes-requested review explaining why.
Sent by Cursor Approval Agent: Dry-Run PR Approver



Summary
Applies the RETRY behavior to FDv2 synchronizer orchestration in the Android SDK, following launchdarkly/java-core#252 and launchdarkly/java-core#253. A synchronizer that fails is parked and retried later, instead of being blocked for good.
Parking
next(), a failure to build, or shutting down on its own. The park delay starts at 5 minutes, doubles with each failure up to 1 hour, and has jitter. After a park, the next synchronizer starts after a failover delay of 0.5-1 seconds.pingevent triggers counts as a success or a failure for the streaming reset threshold.ConnectivityManagernow records an INTERRUPTED status with no error as a failure instead of a successful connection.Directed fallback
Deadlines
System.nanoTime(), so changes to the system clock don't move them.FDv2DataSourceConditionsis removed.Public API
This extends the public
FDv2SourceResultclass incom.launchdarkly.sdk.android.subsystems, the result type that initializers and synchronizers return. It adds two methods:isResetThresholdMet()returns true if the source met its reset threshold at the time of the result. When a synchronizer returns such a result, the data source resets that synchronizer's park count. Results from the existingchangeSet()andstatus()factory methods return false.withResetThresholdMet()returns a copy of the result withisResetThresholdMet()set to true.FDv2SourceResultis part of the early access FDv2 data system. It now carries the same note as the other early access types, saying that it is not stable and not subject to backwards compatibility guarantees or semantic versioning.Not included
FailureClassfrom a newer java-sdk-internal.Retry-After, and reading the TTL from the response. Every directive uses the 1-hour default.Note
Overview
Replaces permanent synchronizer blocking with park/backoff retry: unexpected failures park the active synchronizer (exponential delay from 5 minutes up to 1 hour, with jitter), wait on monotonic deadlines, then pick the next eligible source after a short failover delay. Fallback and recovery are driven inside
FDv2DataSourceviaMonotonicTimewaits instead of the removedFDv2DataSourceConditionstimer futures.Adds a reset threshold on
FDv2SourceResult(isResetThresholdMet()/withResetThresholdMet()): polling/FDv1 fallback report it after two consecutive successful polls; streaming starts a timer (60s by default) after the first healthy result and emits a no-op changeset when the stream stays healthy. Meeting the threshold clears park counts so a recovered synchronizer can become preferred again.FDv1 directive fallback now runs for a default 1-hour TTL (jittered), blocks FDv2 sources during the window, restarts FDv2 when TTL expires, and extends TTL if another directive arrives while already on FDv1. If no FDv1 synchronizer is configured, the data source stays INTERRUPTED with no active synchronizer until retry.
Connectivity treats
INTERRUPTEDstatus without an error as a failure (synthesizing or preserving the last error) so connection info does not show spurious success. Streaming treats an unexpected stream-thread exit as terminal so orchestration can park and rebuild. Initializer FDv1 directives only mark the data source ready when the applied payload includes a selector.Reviewed by Cursor Bugbot for commit 81c3ae7. Bugbot is set up for automated code reviews on this repo. Configure here.