Comments (3)
You didn't say why it looks like a bug to you, so I don't know whether you're missing something, but here's a summary of what the intention is:
- There are two components with different purposes, the "data store" (which is either a simple in-memory store or a database) and the "data source" (which manages the connection to LaunchDarkly for getting flags).
LDClient.isInitialized()
is intended to return true if the SDK has received flag data from LaunchDarkly at least once so far. That is the job of the data source component, so that's why it is delegating todataSource.isInitialized()
.- Even if the SDK has not received flag data from LaunchDarkly, there could still be old flag data present in the data storeβ specifically, if the data store is a database. If so, we can use that data to evaluate flags, even though we would prefer to have more up-to-date flag data. That's what is going on in the first block you quoted.
from java-server-sdk.
So, the specific scenarios that that first block is there to handle are:
- The SDK has not (yet) completed a successful initialization because it has not been able to connect to LaunchDarkly. But, when it calls
dataStore.isInitialized()
, it returns true, indicating that we are using a database and we detected some flag data already in the database (either from a previous run of the application, or put there by another process such as the Relay Proxy). So, we use that data, and we print a warning ("using last known values from data store"). - Or, the SDK has not yet completed a successful initialization, and there is not already data in the data store. So we have no data, there is no way to evaluate flags, and we print a different warning ("data store unavailable").
from java-server-sdk.
ok makes sense, I was confused by similar naming [dataS]tore
with [dataS]ource
, and thought that those both are the same thing.
I'm closing the issue now.
from java-server-sdk.
Related Issues (20)
- Launch Darkly Metrics conflating Version numbers. HOT 3
- Getting numerous Error posting diagnostic event (giving up permanently): HTTP error 401 (invalid SDK key) HOT 2
- Synk reports the low version of okHttp3 dependency HOT 3
- Vulnerability in snakeyaml HOT 3
- LaunchDarkly Client initialing failed even add LaunchDarkly Certificate to java key store. HOT 9
- Add shaded libraries as dependencies to `-thin` jar HOT 2
- Please provide ability to `LDClient` in non-blocking manner HOT 4
- fat jar brings in duplicate copy of `launchdarkly-logging` HOT 3
- Allow lazily computed defaultValues in LDClient to improve code readability HOT 6
- java-server-sdk is vulnerable to CVE-2022-1471 RCE HOT 3
- Builder object is not exist in V6 but is taken as an example in the docs HOT 6
- Evaluation can throw when the same segment is used in multiple rules within a single flag HOT 6
- StreamClosedByServerException: Stream closed by server HOT 13
- Vulnerability CVE-2022-1471 is introduced via SnakeYaml 1.32. Upgrading to 2.0 should fix it. HOT 3
- Have a robust in memory datastore fallback when the persistent data store connection is not working HOT 2
- update to guava 32.0.0 to resolve CVE-2023-2976 HOT 6
- ApiException.getMessage throws NullPointerException when IOException occurs HOT 1
- Stream continuously reset HOT 2
- Support for use of java-server-sdk library in GraalVM native image applications HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java-server-sdk.