You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FfeProduct.UpdateFromRcm replaces the stored version of a flags file when a modified version arrives, instead of appending it.
Reason for change
Fixes#9301. When a flag was disabled or removed for an environment, a running process kept evaluating it with its last value until restart. Rule and variant changes propagated; only removals were lost.
A modified file arrives under the path it already has, and never in the removed set, so FfeProduct kept both the old and the new version. The module merges all stored versions, and a merge only adds or overwrites keys, so a flag missing from the new version was still served from the old one. The stored list also grew by one full copy of the flags file on every update, for the life of the process.
Only the Remote Configuration source is affected. The agentless source replaces the whole configuration on every update.
Origin
#7896 made FfeProduct append a modified file instead of replacing it. Removals still worked, because the module used only the last entry, so the duplicates were only a memory leak.
#8074 changed the module to merge all entries. This is where removals broke.
#8616 rewrote FlagCollection with the same add-or-overwrite merge, so the behaviour did not change.
Implementation details
Remove any entry stored under the incoming path before adding the new one, as suggested in the issue. Go does the equivalent: each update replaces the provider's configuration.
Test coverage
UpdateRemoteConfig_WhenAModifiedFileDropsAFlag_TheFlagIsNoLongerFound: v1 of a file holds two flags, v2 under the same path holds one. The dropped flag returns FLAG_NOT_FOUND, and the kept flag still resolves.
UpdateFromRcm_WhenTheSameFileIsModifiedRepeatedly_HoldsOneVersionOfIt: three updates to one path leave exactly one stored version.
The issue also reports update events arriving as ProviderReady with a null provider name. That was already fixed by #9044, which emits ProviderConfigurationChanged with the provider name, and shipped in Datadog.FeatureFlags.OpenFeature 2.3.1.
Found 0 performance improvements and 11 performance regressions! Performance is the same for 61 metrics, 0 unstable metrics, 71 known flaky benchmarks, 55 flaky benchmarks without significant changes.
Explanation
This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:
🟩 = significantly better candidate vs. baseline
🟥 = significantly worse candidate vs. baseline
We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.
If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.
Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.
More details about the CI and significant changes
You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.
CIs of the difference of means are often centered around 0%, because often changes are not that big:
---------------------------------(------|---^--------)-------------------------------->
-0.6% 0% 0.3% +1.2%
| | |
lower bound of the CI --' | |
sample mean (center of the CI) -------------' |
upper bound of the CI ----------------------'
As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).
For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:
----------------------------------------|---------|---(---------^---------)---------->
0% 1% 1.3% 2.2% 3.1%
| | | |
significant impact threshold --------------' | | |
lower bound of CI --------------' | |
sample mean (center of the CI) --------------------------' |
upper bound of CI ----------------------------------'
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
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.
Summary of changes
FfeProduct.UpdateFromRcmreplaces the stored version of a flags file when a modified version arrives, instead of appending it.Reason for change
Fixes #9301. When a flag was disabled or removed for an environment, a running process kept evaluating it with its last value until restart. Rule and variant changes propagated; only removals were lost.
A modified file arrives under the path it already has, and never in the removed set, so
FfeProductkept both the old and the new version. The module merges all stored versions, and a merge only adds or overwrites keys, so a flag missing from the new version was still served from the old one. The stored list also grew by one full copy of the flags file on every update, for the life of the process.Only the Remote Configuration source is affected. The agentless source replaces the whole configuration on every update.
Origin
FfeProductappend a modified file instead of replacing it. Removals still worked, because the module used only the last entry, so the duplicates were only a memory leak.FlagCollectionwith the same add-or-overwrite merge, so the behaviour did not change.Implementation details
Remove any entry stored under the incoming path before adding the new one, as suggested in the issue. Go does the equivalent: each update replaces the provider's configuration.
Test coverage
UpdateRemoteConfig_WhenAModifiedFileDropsAFlag_TheFlagIsNoLongerFound: v1 of a file holds two flags, v2 under the same path holds one. The dropped flag returnsFLAG_NOT_FOUND, and the kept flag still resolves.UpdateFromRcm_WhenTheSameFileIsModifiedRepeatedly_HoldsOneVersionOfIt: three updates to one path leave exactly one stored version.Other details
Jira: FFL-3338
The issue also reports update events arriving as
ProviderReadywith a null provider name. That was already fixed by #9044, which emitsProviderConfigurationChangedwith the provider name, and shipped inDatadog.FeatureFlags.OpenFeature2.3.1.