Skip to content

Conversation

@kinyoklion
Copy link
Member

@kinyoklion kinyoklion commented Jan 23, 2026

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.

  • Adds FDv2DataSourceConditions with timed FallbackCondition (on prolonged INTERRUPTED) and RecoveryCondition (time-based), and wires them into FDv2DataSource run loop
  • Extracts synchronizer lifecycle into SynchronizerStateManager and SynchronizerFactoryWithState for active-source tracking, rotation, and blocking on terminal errors
  • FDv2DataSource now supports configurable timeouts (defaults: fallback 2m, recovery 5m), applies thread priority, logs via injected LDLogger, and returns FDv1 fallback signal (execution still TODO)
  • FDv2DataSystem constructs FDv2DataSource with threadPriority, DataSource sub-logger, and shared executor; logging refined for polling/streaming components via new names in Loggers
  • Extensive unit tests added for conditions, data source behavior (fallback/recovery/closure), and synchronizer state manager

Written by Cursor Bugbot for commit e6b032e. This will update automatically on new commits. Configure here.

@kinyoklion kinyoklion changed the base branch from main to rlamb/connect-headers-to-data-sources January 23, 2026 23:43

@Override
public void inform(FDv2SourceResult sourceResult) {
// Time-based recovery.
Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Member Author

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.

Base automatically changed from rlamb/connect-headers-to-data-sources to main January 26, 2026 18:11
@kinyoklion

This comment was marked as outdated.

@kinyoklion
Copy link
Member Author

bugbot review

Copy link

@cursor cursor bot left a 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

@kinyoklion kinyoklion marked this pull request as ready for review January 26, 2026 23:52
@kinyoklion kinyoklion requested a review from a team as a code owner January 26, 2026 23:52
Copy link

@cursor cursor bot left a 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.

@tanderson-ld tanderson-ld self-requested a review January 27, 2026 20:26
@kinyoklion kinyoklion merged commit 8d2d922 into main Jan 27, 2026
21 checks passed
@kinyoklion kinyoklion deleted the rlamb/fallback-and-recovery branch January 27, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants