Skip to content

Conversation

@jsonbailey
Copy link
Contributor

@jsonbailey jsonbailey commented Dec 24, 2025

Note

Strengthens availability monitoring and reduces race conditions.

  • Refactors FeatureStoreClientWrapper.__update_availability to minimize time under lock, update state atomically, and start/stop RepeatingTask outside the lock; prevents duplicate pollers and adds clearer availability/unavailability warnings
  • Tweaks error log in the synchronizer loop to "Failed to build synchronizer" for clearer context

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

@jsonbailey jsonbailey requested a review from a team as a code owner December 24, 2025 21:54
elif self.__poller is None:
task_to_start = RepeatingTask("ldclient.check-availability", 0.5, 0, self.__check_availability)
self.__poller = task_to_start
self.__lock.unlock()
Copy link

Choose a reason for hiding this comment

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

Missing try/finally causes deadlock if exception occurs

The refactored __update_availability method removes the try/finally pattern that previously ensured the lock was always released. If any exception occurs between self.__lock.lock() and self.__lock.unlock() (for example, during RepeatingTask construction on line 189), the lock will remain held indefinitely, causing a deadlock for all subsequent operations trying to acquire the same lock. The original code and the equivalent method in ldclient/client.py properly use try/finally to guarantee lock release.

Fix in Cursor Fix in Web

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.

2 participants