Skip to content

fix: Log the isFlagKnown cached-data warning only once per client - #213

Draft
kinyoklion wants to merge 1 commit into
mainfrom
rlamb/log-cached-data-warning-once
Draft

fix: Log the isFlagKnown cached-data warning only once per client#213
kinyoklion wants to merge 1 commit into
mainfrom
rlamb/log-cached-data-warning-once

Conversation

@kinyoklion

Copy link
Copy Markdown
Member

Summary

While the client is not initialized but the data store already holds data, isFlagKnown logs 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 LDClient instance. The check-and-set uses an AtomicBoolean.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 isFlagKnown is the only site.

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