Skip to content

fix: Signal readiness when selectorless initializers are exhausted - #582

Merged
kinyoklion merged 1 commit into
mainfrom
devin/1794594264-fdv2-selectorless-init
Nov 20, 2026
Merged

kinyoklion merged 1 commit into
mainfrom
devin/1794594264-fdv2-selectorless-init

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions
  • Sync/async parity: matching changes made to async_* siblings (or N/A)

Related issues

launchdarkly/ld-relay#979 serves FDv2 full payloads with no selector. When only initializers provided such data, the SDK applied it, but the startup wait signaled readiness only for selector-bearing payloads. Startup then stayed pending until a synchronizer succeeded. The contract test is launchdarkly/sdk-test-harness#600.

Describe the solution you've provided

This implements DATASYSTEM v2 requirements 1.1.3 and 1.1.5:

  • A selector-bearing initializer payload still ends initialization immediately.
  • A selectorless payload is applied, and the remaining initializers still run.
  • When the initializers are exhausted, readiness is raised if the in-memory store was initialized during this run.

store.py exposes the memory store's initialization separately, so data already in a persistent store doesn't trigger readiness. The sync change is in fdv2.py and the matching async change is in async_fdv2.py.

Describe alternatives you've considered

Checking the store's general initialized state. With a persistent store, that would report ready before any data arrived in this process.

Additional context

  • make lint and make test pass (2367 passed).
  • The selectorless group from sdk-test-harness#600 passes 5/5 for both the sync and async contract services.

Link to Devin session: https://app.devin.ai/sessions/f3b22e19bdde48f1b39f77808077390b
Open in Devin Desktop: https://app.devin.ai/desktop/session/f3b22e19bdde48f1b39f77808077390b?variant=devin
Requested by: @kinyoklion

SDK-3726


Note

Overview
Fixes FDv2 startup hanging when initializers only deliver selectorless full payloads (e.g. from LD Relay): sync fdv2.py and async async_fdv2.py now set the readiness event after the initializer chain finishes if data was applied to the in-memory store during that run. Selector-bearing payloads still signal ready immediately and stop further initializers.

store.py adds is_memory_initialized() so readiness reflects in-process initializer data, not a pre-populated persistent store alone. Sync/async tests cover exhaustion with selectorless init (with and without flag data) and the case where only persistent data exists (no premature ready).

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

Co-Authored-By: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@kinyoklion
kinyoklion marked this pull request as ready for review November 19, 2026 22:06
@kinyoklion
kinyoklion requested a review from a team as a code owner November 19, 2026 22:06
@cursor cursor Bot added the risk:medium label Nov 19, 2026

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

Automated risk review (dry run): Medium

This PR would not be automatically approved. Human approval required.

Why: This changes FDv2 startup readiness in fdv2.py, async_fdv2.py, and store.py so selectorless initializer data can mark the client ready after exhaustion. That is a moderate SDK initialization-behavior change, even with tests for exhaustion and persistent-store cases. Human review is needed and no reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Dry-Run PR Approver

@kinyoklion
kinyoklion merged commit fa654b0 into main Nov 20, 2026
21 checks passed
@kinyoklion
kinyoklion deleted the devin/1794594264-fdv2-selectorless-init branch November 20, 2026 17:01
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants