Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning "We recommend blocking no longer than 60 seconds" without an explanation #92

Open
samscott89 opened this issue Jul 26, 2024 · 1 comment

Comments

@samscott89
Copy link

Small nit/documentation question.

We set wait_for_initialization to 120s as a conservative estimate of how long to wait for the client to connect. In production we've observed init taking as long as 25s, so this seemed like a reasonable time. We're now getting warnings from the client.

Two minor requests:
(a) It would have been nice for this to be documented in the API
(b) Can you expand on why we shouldn't wait for longer? For us LD is on the critical path and if we cannot initialize we need to fallback to an offline mode which we would rather avoid.

For completeness, repro is:

let initialized = client.wait_for_initialization(std::time::Duration::from_secs(120)).await;
@keelerm84
Copy link
Member

Thank you for providing this feedback!

(a) It would have been nice for this to be documented in the API

I can raise this issue and work to get some clarification in the documentation. Can you tell me where you think it would be best for us to document this behavior? Would you expect something in the rust docs, the changelog, or on https://docs.launchdarkly.com?

(b) Can you expand on why we shouldn't wait for longer? For us LD is on the critical path and if we cannot initialize we need to fallback to an offline mode which we would rather avoid.

LaunchDarkly SDKs are designed to return evaluation results even if a connection cannot be established with the upstream APIs. During that time, the SDK will return the default_value parameter provided at the variation callsites. Meanwhile, the SDK will continue attempting to connect with LaunchDarkly to finish receiving the payload.

This is why we don't recommend completely blocking your application's ability to serve requests just because we can't connected upstream. You can still serve requests and use the default value.

But you certainly CAN wait longer than the prescribed 60 seconds, as this is just a recommendation from us.

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

No branches or pull requests

2 participants