fix: Do not report a permanent data source failure as fatal - #59
Merged
Conversation
Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
keelerm84
approved these changes
Aug 20, 2026
kinyoklion
pushed a commit
that referenced
this pull request
Aug 20, 2026
🤖 I have created a release *beep* *boop* --- ## [2.2.0](2.1.2...2.2.0) (2026-08-20) ### Features * Stop waiting for initialization after the configured start wait time ([#60](#60)) ([86e3d27](86e3d27)) ### Bug Fixes * Do not report a permanent data source failure as fatal ([#59](#59)) ([ed29935](ed29935)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > Release Please bump from **2.1.2** to **2.2.0**. Updates the package `Version`, `.release-please-manifest.json`, and `CHANGELOG.md`. > > The changelog documents stopping initialization wait after the configured start wait time (#60) and not treating a permanent data source failure as fatal (#59). No runtime code is changed in this PR. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit d648a25. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
A permanently shut down data source set the provider's internal status to
Fatal, even though the LaunchDarkly client can keep evaluating flags from the data it already has.DataSourceState.Offnow setsProviderStatus.Error, matchingInitializeAsyncand the Java providerErrorandFatalemitProviderEventTypes.ProviderError, and the OpenFeature SDK derives provider status from events, so nothing consumed theFatalvalue@cursor review
Implementation details
Why change it if nothing consumes it
Fatalis the OpenFeature status that means "flag resolution cannot happen"; the SDK short-circuits to call-site defaults in that state. That is wrong for LaunchDarkly, since a dead stream (for example a 401 on an established connection) leaves the in-memory store fully usable. The value was only saved from causing that behavior becauseStatusProvidermaps bothErrorandFatalto aProviderErrorevent. Leaving the misleading value in place invites a regression the next time this status is wired to anything.The sibling fix in the Python provider (launchdarkly/openfeature-python-server#52) does have user-visible impact, because that provider emits a fatal event directly.
Alternatives considered
Emitting
StaleforOffwas rejected: the failure is not recoverable without a new client, so consumers should see an error.Testing
dotnet test test/LaunchDarkly.OpenFeature.ServerProvider.Tests -f net8.0— 60 tests pass, including the newItCanEvaluateFlagsAfterTheDataSourceHasBeenShutdown. Note that this test also passes onmain, for the event-mapping reason above; it is a guard, not a reproduction.No visual preview applies — this is a server-side provider change.
Link to Devin session: https://app.devin.ai/sessions/0c452d209ec54b068ba120b4c92b8f6c
Requested by: @kinyoklion
Note
Overview
When the LaunchDarkly data source shuts down permanently (
DataSourceState.Off), the provider now reportsProviderStatus.Errorinstead ofProviderStatus.Fatal, because the LD client can still evaluate flags from in-memory data.This aligns
StatusChangeHandlerwithInitializeAsync(which already usedErrorforOff) and with the Java provider.StatusProviderstill maps bothErrorandFataltoProviderEventTypes.ProviderError, so emitted events are unchanged today; the fix avoids mislabeling the internal status if OpenFeature later treatsFatalas “cannot resolve flags.”A new integration test
ItCanEvaluateFlagsAfterTheDataSourceHasBeenShutdownverifies boolean evaluation through the OpenFeature client after the mocked data source transitions toOff.Reviewed by Cursor Bugbot for commit fbe6159. Bugbot is set up for automated code reviews on this repo. Configure here.