-
Notifications
You must be signed in to change notification settings - Fork 11
chore: Add support for FDv2 fallback and recovery. #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| @Override | ||
| public void inform(FDv2SourceResult sourceResult) { | ||
| // Time-based recovery. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may need to discuss the spec. My interpretation is that the synchronizer just needs to run for the recovery time, not that it needs to be in any specific state.
Considering the fallback time is less than the recovery time, if the data source is in a bad state it will fallback before recovering.
The question is if we care about recovering near having received a changeset. Or if we want changesets to reset the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A condition completes when the conditions requirements are met. It is informed by being fed the data source changes. If doesn't wrap the data sources themselves, because that increases complexity of handling the asynchronous nature, and doesn't clearly separate the responsibility.
A condition could complete inside an inform callback, in which case the state change will be caught in the next loop pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a move to a new file.
This comment was marked as outdated.
This comment was marked as outdated.
lib/sdk/server/src/main/java/com/launchdarkly/sdk/server/FDv2DataSource.java
Show resolved
Hide resolved
lib/sdk/server/src/main/java/com/launchdarkly/sdk/server/FDv2DataSource.java
Show resolved
Hide resolved
…/java-core into rlamb/fallback-and-recovery
|
bugbot review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Adds support for FDv2 fallback and recovery.
This doesn't add support for fallback to FDv1.
It also does not finish data source status support.
It does some refactoring to limit the complexity of the FDv2DataSource by moving some implementation details regarding synchronizer state handling and conditions out of its implementation.
Note
Implements FDv2 fallback/recovery and refactors synchronizer orchestration.
FDv2DataSourceConditionswith timedFallbackCondition(on prolongedINTERRUPTED) andRecoveryCondition(time-based), and wires them intoFDv2DataSourcerun loopSynchronizerStateManagerandSynchronizerFactoryWithStatefor active-source tracking, rotation, and blocking on terminal errorsFDv2DataSourcenow supports configurable timeouts (defaults: fallback 2m, recovery 5m), applies thread priority, logs via injectedLDLogger, and returns FDv1 fallback signal (execution still TODO)FDv2DataSystemconstructsFDv2DataSourcewiththreadPriority,DataSourcesub-logger, and shared executor; logging refined for polling/streaming components via new names inLoggersWritten by Cursor Bugbot for commit e6b032e. This will update automatically on new commits. Configure here.