Repository navigation
Conversation
4992afc to
9df0441
Compare
9df0441 to
468d47a
Compare
346c0d3 to
f0596a8
Compare
| active_conditions_.reset(); | ||
| } | ||
| StartSynchronizers(); | ||
| } |
There was a problem hiding this comment.
Stale shutdown aborts FDv2 retry
High Severity
OnFDv2RetryTimer closes the FDv1 adapter while its Next() is still in the orchestrator's WhenAny. That unblocks the old future with Shutdown, which is posted onto the executor after the new FDv2 synchronizer has already been started. OnSynchronizerResult then treats that stale Shutdown as belonging to the replacement and resets active_synchronizer_, so the SDK is left with no live source after the TTL elapses.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit f0596a8. Configure here.
|
Note Agent disclosure: this comment and the linked branch were produced by an AI agent (Claude Code) working for @kinyoklion, as part of a multi-agent review of this PR. The failure was reproduced and the fix checked by building and running the client unit tests locally (Debug, ASan/UBSan). Please review it with that in mind. The FDv2 retry after the fallback TTL tears down the synchronizer it just startedThis is the problem Bugbot raised here. It reproduces in a unit test, and it happens every time the TTL expires while the FDv1 tier is active. What happens (line links are at f0596a8):
After that there is no synchronizer and no retry timer, and the status still reads VALID from the last FDv1 data. Flag updates stop silently until the next identify. #619 gives every built-in mode an FDv1 fallback, so once it lands this would happen on every TTL expiry. The same root cause shows up in a narrower window too. If an FDv1 result has already been posted when the retry runs, it is applied after FDv2 has restarted, and it calls
Branch with a test and a fix
With the fix, the full client unit suite passes (236 tests). Another way to fix it is to put the TTL future into the same A heads-up, not verified: the server SDK's |
f0596a8 to
859218a
Compare
There was a problem hiding this comment.
Risk: high.
Automated risk review (dry run): High
This PR would not be automatically approved. Human approval required.
Why: Client FDv2 fallback in fdv2_data_source.cpp and fdv1_adapter_synchronizer.cpp changes live streaming, and unresolved Bugbot findings include a high-severity stale shutdown that can drop the active synchronizer after the fallback TTL.
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
859218a to
81b74a7
Compare
81b74a7 to
204dc29
Compare
204dc29 to
68a8e7e
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ 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 68a8e7e. Configure here.
| DataSourceStatus::DataSourceState::kInterrupted, | ||
| DataSourceStatus::ErrorInfo::ErrorKind::kUnknown, | ||
| kNoFDv1FallbackConfigured); | ||
| return; |
There was a problem hiding this comment.
Fallback disconnect bypasses shutdown fence
Medium Severity
When no FDv1 fallback is configured, both the initializer and synchronizer paths call status_manager_->SetState after releasing mutex_, without GuardShutdown. A concurrent ShutdownAsync can already have published initializing and set closed_, so this write overwrites the replacement source's status.
Additional Locations (1)
Triggered by learned rule: Client FDv2DataSource: basis is selector; GuardShutdown fences store
Reviewed by Cursor Bugbot for commit 68a8e7e. Configure here.




Summary
Honors the service's directive to move the client off FDv2 back to FDv1, and provides an FDv1 source to fall back to.
Note
Overview
Adds
FDv1AdapterSynchronizer, which wraps a legacy FDv1 data source behind the FDv2IFDv2Synchronizerinterface by translatingInit/Upsert/Applyinto FDv2 changesets and mapping data-source status errors toInterrupted/TerminalErrorresults.FDv2DataSourcenow reacts when initializer or synchronizer results include anfdv1_fallbackdirective: it still applies any accompanying payload, switches the synchronizer tier to the configured FDv1 fallback viaSourceManager, schedules a TTL-based FDv2 retry (with cancellation on close), and reportskInterruptedwhen the service requests FDv1 but no fallback tier is configured.Test coverage covers adapter lifecycle/translation behavior and end-to-end fallback orchestration (apply-on-fallback, FDv1 tier start, disconnect without FDv1, FDv2 retry after TTL).
Reviewed by Cursor Bugbot for commit 68a8e7e. Bugbot is set up for automated code reviews on this repo. Configure here.