Skip to content

feat: orchestrator switches to FDv1 fallback on directive#539

Open
beekld wants to merge 10 commits into
mainfrom
beeklimt/SDK-2379-3
Open

feat: orchestrator switches to FDv1 fallback on directive#539
beekld wants to merge 10 commits into
mainfrom
beeklimt/SDK-2379-3

Conversation

@beekld

@beekld beekld commented May 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the FDv1 fallback directive in the FDv2 data system with TTL-based recovery.

  • FDv2SourceResult carries std::optional<FDv1FallbackDirective> with a TTL (default 1h, 0 = indefinite).
  • Sources parse X-LD-FD-Fallback-TTL (header) and protocolFallbackTTL (goodbye).
  • On directive: switch to FDv1 if configured, otherwise disconnect (kInterrupted). Schedule retry after TTL.
  • On TTL elapse: SourceManager::SwitchBackToFDv2() re-enables FDv2 (including previously terminal-error-blocked factories), blocks FDv1, restarts synchronizers.

End-to-end fallback will work once an FDv1 streaming source is wrapped as an IFDv2Synchronizer (#540).

Test plan

  • SourceManager tests cover the new block/unblock semantics
  • Source-level tests cover TTL parsing (HTTP + goodbye), default, malformed
  • Orchestrator tests cover directive flows in initializer/synchronizer paths, TTL elapse rebuild, FDv2 recovery
  • Full server suite green

@beekld beekld force-pushed the beeklimt/SDK-2379-2 branch from 1833a9c to d795752 Compare May 28, 2026 18:21
@beekld beekld force-pushed the beeklimt/SDK-2379-3 branch from 9f04fa3 to ea3b92b Compare May 28, 2026 18:22
@beekld beekld force-pushed the beeklimt/SDK-2379-2 branch from d795752 to 12b23ec Compare May 28, 2026 20:18
@beekld beekld force-pushed the beeklimt/SDK-2379-3 branch from ea3b92b to 142b2ff Compare May 28, 2026 20:19
@beekld beekld force-pushed the beeklimt/SDK-2379-2 branch from 12b23ec to 96a7f5a Compare May 28, 2026 23:22
@beekld beekld force-pushed the beeklimt/SDK-2379-3 branch 3 times, most recently from e2824ec to f0b2aab Compare May 29, 2026 00:32
@beekld beekld force-pushed the beeklimt/SDK-2379-2 branch from 762768c to 57d4dfb Compare May 29, 2026 21:12
@beekld beekld force-pushed the beeklimt/SDK-2379-3 branch from f0b2aab to f94ce01 Compare May 29, 2026 21:17
@beekld beekld force-pushed the beeklimt/SDK-2379-2 branch from 57d4dfb to c95b74a Compare May 29, 2026 21:18
@beekld beekld force-pushed the beeklimt/SDK-2379-3 branch 2 times, most recently from eb28df0 to 3e76ae5 Compare May 29, 2026 21:45
Base automatically changed from beeklimt/SDK-2379-2 to main June 3, 2026 21:37
@beekld beekld force-pushed the beeklimt/SDK-2379-3 branch 2 times, most recently from bfe0441 to af660a0 Compare June 4, 2026 21:54
@beekld beekld changed the base branch from main to beeklimt/contract-test-url-encoding June 4, 2026 22:02
@beekld beekld force-pushed the beeklimt/SDK-2379-3 branch 2 times, most recently from 18951d8 to 35aa744 Compare June 4, 2026 23:51
@beekld beekld force-pushed the beeklimt/contract-test-url-encoding branch from 1714aee to 3488e09 Compare June 4, 2026 23:51
Base automatically changed from beeklimt/contract-test-url-encoding to main June 5, 2026 17:50
@beekld beekld force-pushed the beeklimt/SDK-2379-3 branch from 35aa744 to 5a2a9bc Compare June 5, 2026 18:07
@beekld beekld marked this pull request as ready for review June 8, 2026 16:57
@beekld beekld requested a review from a team as a code owner June 8, 2026 16:57

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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 303b3a8. Configure here.

data_interfaces::FDv1FallbackDirective{
std::chrono::seconds(*r.protocol_fallback_ttl)};
}
Notify(std::move(goodbye_result));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fallback goodbye still restarts SSE

Medium Severity

When a goodbye event includes an FDv1 fallback directive (protocolFallbackTTL or a merged fallback header on the result), the orchestrator now switches away from the FDv2 streaming synchronizer and shuts it down. The goodbye handler still always calls async_restart afterward, so the client can start a reconnect on the same connection the orchestrator is closing.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 303b3a8. Configure here.

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.

1 participant