fix: Log the isFlagKnown cached-data warning only once per client - #213
Draft
kinyoklion wants to merge 1 commit into
Draft
fix: Log the isFlagKnown cached-data warning only once per client#213kinyoklion wants to merge 1 commit into
kinyoklion wants to merge 1 commit into
Conversation
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
While the client is not initialized but the data store already holds data,
isFlagKnownlogs a warning on every call. A client that stays in that state, for example one serving persisted data before its data source connects, emits that warning for every check, which floods the log without adding information.The warning now logs once per
LDClientinstance. The check-and-set uses anAtomicBoolean.compareAndSet, which is lock-free and only runs on the path where the warning may be needed, so normal calls are unaffected. The message says that it is logged once.The sibling message for an uninitialized store, and the gating condition itself, are unchanged. The evaluation path in this SDK has no equivalent cached-data message, so
isFlagKnownis the only site.