Repository navigation
Conversation
… listener Listeners run on a data system thread, and stopping the FDv2 data system joined every one of its threads, including that one. The join raised, so the data store and big segment store were left open.
…stener A flag change listener called by an override update held the override sink lock, and close waited for that lock forever. Listeners are now notified after the lock is released. The FDv1 file data source with watchdog called listeners on the observer thread, and stop joined that thread. Stop now skips the join on that thread. A close from a listener during Store.apply let apply write the change set to the closed persistent store. The store now stops persisting after close.
There was a problem hiding this comment.
Risk: medium.
Automated risk review (dry run): Medium
This PR would not be automatically approved. Human approval required.
Why: This changes core client close/stop behavior across FDv2 thread join, the file data source observer thread, override-sink lock ordering, and persistent-store writes after close. Those interacting lifecycle paths are bounded by tests, but they are not a narrow low-risk change.
If you disagree with this review, share this PR in #feedback-agent-approvals or submit a changes-requested review explaining why.
Human review is needed and no reviewers were assigned.
Sent by Cursor Approval Agent: Dry-Run PR Approver
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.


Summary
Closing the client from inside a listener now works on every thread the SDK calls listeners on.
Note
Overview
Fixes shutdown and lifecycle bugs when
client.close()(or equivalent stop) is triggered from inside a listener callback on the same thread that is applying an update.Thread self-join:
FDv2.stop()and the file data source’s watchdogstop()now skipjoin()on the current thread so close/stop no longer raises or blocks when invoked from a flag-change or reload path.Override sink deadlock:
OverrideSinkImplapplies updates under its lock, then calls_notify_allafter releasing the lock, so a listener can close the sink/client without waiting forever on the lock.Store after close: The FDv2
Storetracks_closedand_should_persist()refuses writes once closed, so an in-flightapplythat notified a closing listener does not persist to the persistent feature store.Regression coverage adds listener-driven close scenarios for FDv2, override sink, file auto-update (watchdog and polling), and full
LDClient(flag and data-store status listeners).Reviewed by Cursor Bugbot for commit d17de3d. Bugbot is set up for automated code reviews on this repo. Configure here.