Skip to content

fix: Prevent a false synchronizer failure warning when an FDv2 client closes - #584

Merged
keelerm84 merged 1 commit into
mainfrom
mk/SDK-3604/false-sync-failure-on-close
Nov 18, 2026
Merged

keelerm84 merged 1 commit into
mainfrom
mk/SDK-3604/false-sync-failure-on-close

Conversation

@keelerm84

@keelerm84 keelerm84 commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

fix: Report the FDv2 data source status as OFF after close when more than one synchronizer is configured

Summary

When an FDv2 client closed, the data system treated the end of the active synchronizer as a failure. It logged "Synchronizer ... permanently failed, removing from list", and with one synchronizer it also logged "No more synchronizers available". Now the synchronizer loop checks for stop first and exits without either warning.

The data source status reached OFF on close only when the last synchronizer was removed. With two or more synchronizers, which the default configuration has, the status stayed VALID after close. Now stop() sets the status to OFF after its threads finish, whatever synchronizers are configured.

The polling synchronizer cleared its stop flag when sync() started. A stop that arrived first was lost, and the synchronizer sent another poll request after close. Now the flag stays set, and sync() ends at once.

Each change applies to both the sync and the async data system.


Note

Overview
Fixes shutdown behavior for FDv2 clients so a normal close is not mistaken for synchronizer failure and status/logging stay correct.

Polling synchronizers (PollingDataSource / AsyncPollingDataSource) no longer clear stop/interrupt flags when sync() starts, so a stop() that happens first is honored and the loop exits without an extra poll.

FDv2 coordinators (FDv2 / AsyncFDv2) check _stop_event after a synchronizer ends and exit the loop without processing failure directives, avoiding false “permanently failed” / “no more synchronizers” warnings. stop() now always sets data source status to OFF after background work finishes, including when multiple synchronizers are configured (where status could previously remain VALID).

Tests cover no-poll-after-early-stop, stop reporting OFF without warning-level logs, and parametrized single vs. multiple synchronizers for sync and async paths.

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

@keelerm84
keelerm84 requested a review from a team as a code owner November 16, 2026 15:02

@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.

Risk: low.

Automated risk review (dry run): Low

This PR would be automatically approved.

Why: The change is a narrow FDv2 shutdown fix in fdv2.py, async_fdv2.py, polling.py, and async_polling.py, with tests that cover status OFF on close, no false failure warnings, and no poll after an early stop.

If you disagree with this review, share this PR in #feedback-agent-approvals or submit a changes-requested review explaining why.

Open in Web View Automation 

Sent by Cursor Approval Agent: Dry-Run PR Approver

@cursor cursor Bot added the risk:low label Nov 16, 2026
@keelerm84
keelerm84 merged commit 5721c67 into main Nov 18, 2026
19 checks passed
@keelerm84
keelerm84 deleted the mk/SDK-3604/false-sync-failure-on-close branch November 18, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants