Skip to content

Conversation

@jsonbailey
Copy link
Contributor

@jsonbailey jsonbailey commented Jan 6, 2026

Note

Introduces context-managed read/write locking and refactors SDK code to use it for clearer, safer concurrency.

  • Adds ReadWriteLock.read()/write() context managers and updates all locking sites to with blocks (replacing manual lock()/unlock() and rlock()/runlock()) across ldclient/__init__.py, client.py, feature_store.py, data source/store status providers, FDv2 datasystem (wrapper, store, lifecycle), listeners, flag tracker, and integrations/test_data*
  • Minor internal cleanups while preserving behavior (e.g., poller start/stop guarded by write locks, listener lists copied under read locks)

Written by Cursor Bugbot for commit cf0f77a. This will update automatically on new commits. Configure here.

@jsonbailey jsonbailey marked this pull request as ready for review January 6, 2026 16:23
@jsonbailey jsonbailey requested a review from a team as a code owner January 6, 2026 16:23
@jsonbailey jsonbailey changed the title fix: Add context manager to rw lock fix: Add context manager for clearer/safer locks Jan 6, 2026
@jsonbailey jsonbailey changed the title fix: Add context manager for clearer/safer locks fix: Add context manager for clearer, safer locks Jan 6, 2026
global __lock
try:
__lock.lock()
c = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A thing of beauty.

@jsonbailey jsonbailey merged commit beca0fa into main Jan 6, 2026
15 checks passed
@jsonbailey jsonbailey deleted the jb/sdk-1710/lock-context-manager branch January 6, 2026 21:36
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.

4 participants