Skip to content

fix: fall back from a silent synchronizer during FDv2 startup - #461

Merged
tanderson-ld merged 4 commits into
v7from
ta/SDK-3007/fdv2-init-fallback-fix
Oct 12, 2026
Merged

tanderson-ld merged 4 commits into
v7from
ta/SDK-3007/fdv2-init-fallback-fix

Conversation

@tanderson-ld

@tanderson-ld tanderson-ld commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Requirements

  • I have followed the repository's pull request submission guidelines
  • I have added test coverage for new or changed functionality
  • I have validated my changes against all supported platform versions — n/a, no platform-specific behavior

Related issues

SDK-3235. Also fixes the one known failure in the nightly contract tests added in #454: streaming/fdv2/permanent fallback with recovery.

Describe the solution you've provided

The data system has two fallback timers, selected by reading the status: a 10-second one for startup (cannotInitialize) and a 1-minute one for steady state (interruptedAtRuntime).

A synchronizer that fails permanently during startup reports Off, which the loop publishes as Interrupted. Nothing restores Initializing, so the startup branch — which tested the status value — was unreachable for the rest of startup, leaving only the 1-minute timer. That only becomes visible when the next synchronizer connects and then stays silent: it produces no result for the loop to act on, so the loop depends entirely on the timer, and the client's start-wait expires first. The healthy source is never contacted.

-cannotInitialize := status.State == interfaces.DataSourceStateInitializing &&
+cannotInitialize := !fdv2.dataApplied.Get() &&
     time.Since(status.StateSince) > 10*time.Second

Keying on whether data has ever been applied expresses the actual predicate and cannot go stale as states are added. Runtime behavior is unchanged: once data is applied, only the 1-minute timer applies.

Pre-existing, not a regression — it reproduces on 7.15.6, before the RETRY work.

Describe alternatives you've considered

  • Resetting the status to Initializing on removal. Rejected on cross-SDK evidence: Java and .NET both report INITIALIZING → INTERRUPTED and neither re-publishes Initializing after a source fails. .NET makes that choice explicitly ("spoof interrupted"). This keeps Go's externally visible status sequence identical to today's and consistent with both siblings.
  • Adding Interrupted to the startup branch's state check. Rejected: Interrupted && >10s subsumes Interrupted && >1min, which would make the runtime timer dead code and abandon a source after 10 seconds instead of a minute — and recovery back to it takes 5 minutes of healthy operation.
  • Only refreshing StateSince on the transition. Insufficient: the 1-minute timer would restart and fire at ~70s, still past a 60s start-wait.

Additional context

The fallback and recovery conditions had zero execution coverage before this (the closure bodies measured 0 executions, while the file overall sat at 59.6%) — they are only evaluated on a 10-second tick with 2+ synchronizers configured, which nothing but the long-running contract test reached. The new in-package tests cover both the predicate and the multi-synchronizer loop path, and both fail when the fix is reverted.

Verified: all 4 streaming/fdv2 fallback contract tests pass against the patched SDK, including the recovery assertion that had never executed for Go; all 28 root-package FDv2 end-to-end tests pass; golangci-lint reports 0 issues.


Note

Overview
Fixes FDv2 multi-synchronizer startup so a synchronizer that connects but never delivers data can still be abandoned within the 10s window, even after an earlier source fails permanently and the data source status stays Interrupted instead of Initializing.

The startup branch of fallbackCond now keys off !fdv2.dataApplied rather than DataSourceStateInitializing, so the short timer stays active until the first payload is applied; steady-state behavior after data has been applied is unchanged (still 1 minute on Interrupted).

Adds in-package tests that exercise the predicate (including Interrupted before any data) and a multi-synchronizer loop that waits out the real 10s fallback twice past a silent synchronizer.

Reviewed by Cursor Bugbot for commit fc2eca8. Bugbot is set up for automated code reviews on this repo. Configure here.

A synchronizer that fails permanently during startup reports Off, which
the data system publishes as Interrupted. Nothing restored Initializing,
so the ten-second startup fallback branch -- which tested the status
value -- was unreachable for the rest of startup and only the one-minute
runtime timer applied. When the next synchronizer connected and then
stayed silent it produced no result for the loop to act on, so the
client's start-wait expired before the fallback could advance to a
healthy source.

Key the startup branch on whether data has ever been applied rather than
on the status value. The fallback and recovery conditions previously had
zero execution coverage; this adds in-package tests for both the
predicate and the multi-synchronizer loop path.

SDK-3235
@tanderson-ld
tanderson-ld requested a review from a team as a code owner October 1, 2026 15:22

@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 338196d. Configure here.

Comment thread internal/datasystem/fdv2_datasystem.go Resolved
tanderson-ld and others added 2 commits October 12, 2026 10:40
Describe what the startup and steady-state windows mean and how they are
told apart, rather than narrating the previous status-keyed condition.
The history belongs in the pull request, not in the code.
@tanderson-ld
tanderson-ld merged commit c66100e into v7 Oct 12, 2026
30 checks passed
@tanderson-ld
tanderson-ld deleted the ta/SDK-3007/fdv2-init-fallback-fix branch October 12, 2026 17:59
tanderson-ld pushed a commit that referenced this pull request Oct 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[7.19.1](v7.19.0...v7.19.1)
(2026-10-12)


### Bug Fixes

* fall back from a silent synchronizer during FDv2 startup
([#461](#461))
([c66100e](c66100e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Overview**
> **Release 7.19.1** — bumps the SDK version from **7.19.0** to
**7.19.1** via Release Please (`internal/version.go`,
`.release-please-manifest.json`) and adds the matching **CHANGELOG**
entry.
> 
> The release ships one behavioral fix (already merged as
[#461](#461)):
during **FDv2** startup, the synchronizer loop now **falls back past a
“silent” synchronizer** (one that never reports status or data). Startup
fallback is keyed off whether **any data has been applied**, not only on
data-source status, so a permanently failed first synchronizer followed
by a non-reporting second no longer blocks reaching a later healthy
synchronizer within the **10-second** startup window.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
e9070d1. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

2 participants