Repository navigation
fix: Tolerate status updates with no error in the data source outage tracker - #293
Merged
Merged
Conversation
…tracker OutageTracker.recordError dereferenced the error of every INTERRUPTED update, but DataSourceUpdateSink.updateStatus allows the error to be null. FDv2DataSource reports INTERRUPTED with no error while all synchronizers are backing off, which threw a NullPointerException, ended the data source loop, and stopped all further requests. Only record an error when one is present; the outage is still started and timed. Fixes #292
joker23
approved these changes
Dec 1, 2026
beekld
approved these changes
Dec 1, 2026
tanderson-ld
pushed a commit
that referenced
this pull request
Dec 1, 2026
🤖 I have created a release *beep* *boop* --- ## [7.19.2](launchdarkly-java-server-sdk-7.19.1...launchdarkly-java-server-sdk-7.19.2) (2026-12-01) ### Bug Fixes * Tolerate status updates with no error in the data source outage tracker ([#293](#293)) ([240fd36](240fd36)) --- 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 7.19.2** for `launchdarkly-java-server-sdk`: bumps the package version from **7.19.1** to **7.19.2** in the Release Please manifest, Gradle `version`, `Version.SDK_VERSION`, and **CHANGELOG**. > > The changelog records a **bug fix** ([#293](#293)): the **data source outage tracker** now handles status updates that carry **no error** (e.g. interrupted/recovery transitions without an `ErrorInfo`) instead of assuming every tracked update includes an error. > > There is **no application logic** in this diff beyond version and release metadata; the fix itself is included in the release tag this PR prepares. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit ae593ae. 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.
Fixes #292
Tracks SDK-3795
Problem
With the FDv2 data system,
FDv2DataSourcereportsINTERRUPTEDwith no error while every synchronizer is backing off.DataSourceUpdatesImpl.updateStatushands that null error to the outage tracker, andOutageTracker.recordErrordereferences it. The resultingNullPointerExceptionreaches the catch-all in the data source loop, which logs "Unexpected error in data source" and closes the source manager. No synchronizer starts again, so the client stops making requests even after the cause (for example a 401) is resolved.The tracker is enabled by default (
logDataSourceOutageAsErrorAfteris 1 minute), so default configurations are affected. Setting it tonullavoids the crash.Affected versions: 7.18.0 through 7.19.1 and
main. The null-error call was added with the RETRY orchestration change in 7.18.0 (#252). It is not present in 7.17.3 or earlier.Change
OutageTracker.trackDataSourceStaterecords an error only when the update carries one. The outage is still started and its timeout still scheduled, so an outage whose first report has no error is still timed.This follows the
DataSourceUpdateSink.updateStatuscontract, which documentsnewErroras "information about a new error, if any". The public status is unchanged:updateStatusalready keeps the previouslastErrorwhen it is given null, and errors reported earlier are already counted.The
INTERRUPTEDcall with a null error inFDv2DataSourceis left as is. It asserts the state while every synchronizer is parked, and the earlier errors are already in the status and the outage counts. Passing the last error again would count it once per wake-up.Tests
Two new tests in
DataSourceUpdatesImplTest, both failing with the NPE without the change:The full
lib/sdk/servertest suite passes locally. I did not run the end-to-end 401 reproduction from the issue.Follow-ups (not in this PR)
FileDataSourceImplreportsINTERRUPTEDwith no error when its initial read fails, although it has the exception in hand.FDv2DataSourceloop ends the data source permanently. Making that per-iteration would limit the impact of future bugs of this kind.Note
Overview
Fixes a NullPointerException in the data source outage tracker when
updateStatusis called withINTERRUPTEDand a null error—behavior the FDv2 data source uses while synchronizers are backing off.OutageTracker.trackDataSourceStatenow callsrecordErroronly whennewError != null. Outage detection, error accumulation for real errors, and the delayed outage log timeout are unchanged: an outage can still start and be timed even when the first or subsequent status update carries no error.Two unit tests cover null-error updates during an existing outage and as the first interrupted report.
Reviewed by Cursor Bugbot for commit 6a773f5. Bugbot is set up for automated code reviews on this repo. Configure here.