Skip to content

feat!: Require status and close methods on feature stores - #558

Open
keelerm84 wants to merge 5 commits into
feat/10.xfrom
mk/SDK-63/store-status-methods
Open

keelerm84 wants to merge 5 commits into
feat/10.xfrom
mk/SDK-63/store-status-methods

Conversation

@keelerm84

@keelerm84 keelerm84 commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Summary

Custom FeatureStore and AsyncFeatureStore implementations must now define is_monitoring_enabled, is_available and close. Custom FeatureStoreCore and AsyncFeatureStoreCore implementations must define is_available and close. The methods are abstract, so a store that omits one cannot be instantiated. A store with no outage state can return False from is_monitoring_enabled, return True from is_available, and do nothing in close.

The SDK no longer checks whether these methods exist. CachingStoreWrapper and AsyncCachingStoreWrapper always report status monitoring as enabled and delegate is_available and close to the core. The async in-memory store's is_available is now a coroutine, to match the async interface. The Redis and Consul stores now release their connections in close.


Note

Overview
This PR makes is_monitoring_enabled, is_available, and close required on FeatureStore / AsyncFeatureStore, and is_available / close required on the core interfaces used with caching wrappers. The SDK stops probing for optional methods with getattr/hasattr; wrappers always delegate to the underlying store/core instead.

Caching wrappers now always report monitoring as enabled and forward availability and shutdown directly. Built-in and integration stores gain concrete close behavior where needed (Redis pool disconnect, Consul HTTP session close, no-op for in-memory/DynamoDB). Async in-memory is_available is now async to match the interface.

Client lifecycle closes the feature store when FDv1/Async FDv1 stops. The sync FDv1 _FeatureStoreClientWrapper adds a write lock so close() waits for in-flight writes, ignores writes after close, and avoids starting availability pollers once closed—reducing races with status listeners that call close on failure.

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

Custom FeatureStore and AsyncFeatureStore implementations must now
implement is_monitoring_enabled, is_available, and close. Custom
FeatureStoreCore and AsyncFeatureStoreCore implementations must now
implement is_available and close. These methods are abstract, so a store
that omits one cannot be instantiated.

The SDK no longer probes for these methods. CachingStoreWrapper and
AsyncCachingStoreWrapper always report status monitoring as enabled and
delegate is_available and close to the core. The async in-memory store's
is_available is now a coroutine, to match the async interface.
@keelerm84
keelerm84 requested a review from a team as a code owner November 2, 2026 20:34

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

Stale Bugbot comment from a previous run.

Comment thread ldclient/impl/datasystem/fdv1.py Resolved
Comment thread ldclient/impl/datasystem/fdv1.py Resolved
FDv1 stop now closes the feature store, as FDv2 does, so persistent
stores release their connections when the client closes. The sync store
wrapper also records that it is closed, so a store failure after close
does not start a new availability poller.

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

Stale Bugbot comment from a previous run.

Comment thread ldclient/impl/datasystem/fdv1.py Resolved

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

Stale Bugbot comment from a previous run.

Comment thread ldclient/impl/datasource/polling.py Resolved

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

Comment thread ldclient/impl/datasystem/fdv1.py Resolved
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.

1 participant