Closed farioas closed 1 year ago
I may be misunderstanding your description of the issue, but this seems to me to be intended behavior rather than a bug. I'll explain what the intention was.
That is standard behavior across all of our server-side SDKs that have any database integrations.
In other words, unless I'm misunderstanding your report, it is not "ignoring" the Redis cache. If there is flag data in Redis, and you do a flag evaluation, then the SDK will log a warning, but it should also be reading the flag data from Redis and using it to do your evaluation.
~I have some uncertainty here because you didn't mention the full log line— there are actually two different possible log messages that include the text you mentioned. And you also didn't mention whether the flag evaluation is in fact returning a reasonable value based on what the flag data in Redis was. But what I would expect is that the flag evaluation would use that flag data, and that the full log line would be this:~
(Update: sorry, I just reread your message and saw where you quoted the full log line. And indeed it was the one that I expected, which is this one:)
Feature Flag evaluation attempted before client has initialized - using last known values from feature store for feature key: <your flag key>
If it did not see any data in Redis, then it would be:
Feature Flag evaluation attempted before client has initialized! Feature store unavailable - returning default: <the default value parameter that you passed to variation()>
It is explicitly telling you that it is "using last known values from feature store", i.e. the cached data in Redis.
Thanks for such a detailed explanation, this should be published somewhere in documentation, especially sequence from your 1st message as a sequence diagram.
Yes - I've asked the documentation team to look into making this clearer in docs.
Is this a support request? no
Describe the bug We're using Redis as a feature store cache. The logs are full of warning saying
Feature Flag evaluation attempted before client has initialized
.To reproduce Client initialization:
uwsgi short config:
! Note: we're using
lazy-apps
mode, it will load an application one time per worker instead of preforking.Expected behavior There should be no warnings, because the feature store cache should be consulted prior initialization.
Logs
SDK version
Language version, developer tools Python 3.8.10 uwsgi 2.0.21
OS/platform Ubuntu 20.04
Additional context The issue is very similar to https://github.com/launchdarkly/java-server-sdk/issues/107