Repository navigation
fix: Prevent a false synchronizer failure warning when an FDv2 client closes - #584
Merged
Merged
Conversation
There was a problem hiding this comment.
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.
Sent by Cursor Approval Agent: Dry-Run PR Approver
joker23
approved these changes
Nov 17, 2026
tanderson-ld
pushed a commit
that referenced
this pull request
Dec 1, 2026
🤖 I have created a release *beep* *boop* --- ## [9.21.1](9.21.0...9.21.1) (2026-11-30) ### Bug Fixes * Drop track events with a NaN or infinite metric value ([#599](#599)) ([6a0e1bf](6a0e1bf)) * Prevent a false synchronizer failure warning when an FDv2 client closes ([#584](#584)) ([5721c67](5721c67)) * Prevent a null prerequisites list from stopping the client from initializing ([#587](#587)) ([298e2a3](298e2a3)) * Prevent an FDv2 initializer result from being applied after close ([#583](#583)) ([85e948c](85e948c)) * Report the FDv2 data source status as OFF after close when more ([5721c67](5721c67)) * Restart the stream when a delete event has a version that is not an integer ([#585](#585)) ([cf8b84a](cf8b84a)) * Signal readiness when selectorless initializers are exhausted ([#582](#582)) ([fa654b0](fa654b0)) ### Documentation * Explain the cached data warning from the FDv2 file data source ([#591](#591)) ([5cc96b0](5cc96b0)) --- 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** > This PR **bumps the LaunchDarkly Python server SDK from 9.21.0 to 9.21.1** via Release Please—updating `pyproject.toml`, `ldclient/version.py`, `.release-please-manifest.json`, and the provenance example version. > > The new **CHANGELOG** entry for 9.21.1 documents what ships in this patch: FDv2 lifecycle and streaming fixes (initializer results after close, data source status OFF on close, false synchronizer warnings, non-integer delete versions restarting the stream, selectorless initializer readiness), client init when prerequisites are null, dropping track events with NaN/infinite metrics, and docs for the FDv2 file data source cached-data warning. > > No runtime code appears in the diff; this is the release metadata and changelog for fixes already merged on `main`. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 458695f. 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


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, andsync()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 whensync()starts, so astop()that happens first is honored and the loop exits without an extra poll.FDv2 coordinators (
FDv2/AsyncFDv2) check_stop_eventafter 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 toOFFafter background work finishes, including when multiple synchronizers are configured (where status could previously remainVALID).Tests cover no-poll-after-early-stop, stop reporting
OFFwithout 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.