chore: Add support for FDv2 fallback and recovery.#113
Conversation
|
|
||
| @Override | ||
| public void inform(FDv2SourceResult sourceResult) { | ||
| // Time-based recovery. |
There was a problem hiding this comment.
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.
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.
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.
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.