[FeatureFlags] Replay the configuration handler on registration and bump the OpenFeature package - #9264
Conversation
… OpenFeature package The Remote Configuration subscription is live from module construction, so a payload can land before application code builds a provider and registers a handler. The handler only fired on a change, so a caller waiting on it waited forever. Invoke it at registration when configuration is already held. Bump Datadog.FeatureFlags.OpenFeature to 2.3.1 so the initialization fix can ship: 2.3.0 is already published and immutable.
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (9264) and master. ✅ No regressions detected |
BenchmarksBenchmark execution time: 2026-09-17 12:27:21 Comparing candidate commit c4fe818 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 71 metrics, 1 unstable metrics, 64 known flaky benchmarks, 62 flaky benchmarks without significant changes.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1e41ab118
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
leoromanovsky
left a comment
There was a problem hiding this comment.
Thanks for the thorough testing here. Is there a risk of them being flakey?
Summary of changes
FeatureFlagsModule.RegisterOnNewConfigEventHandlernow invokes the handler immediately when a configuration is already held.Datadog.FeatureFlags.OpenFeaturepackage version 2.3.0 → 2.3.1.Reason for change
The Remote Configuration subscription is live from module construction, which is tracer startup. Application code builds the provider and registers the configuration handler much later. The handler only fired on a change, so a configuration that arrived in that window never reached it, and an application that waits on the handler as its readiness signal waits forever.
Datadog.FeatureFlags.OpenFeature2.3.0 is already published on nuget.org and is immutable. TheInitializeAsyncfix in #9044 rewrites a method that lives in that package, so it cannot reach any customer until the package version moves.Implementation details
Registration reads
_evaluator. A non-null value means a configuration was applied, so the handler is invoked once at registration. The invoke is wrapped in a try/catch that logs a warning, matchingApplyConfiguration: the handler is application code and must not fail the caller.2.3.1 follows the scheme documented in the csproj: the first two digits mirror the referenced OpenFeature version, the third digit is our own patch counter. The
OpenFeaturePackageReferencestays at 2.3.0.Test coverage
Three facts in
FeatureFlagsModuleTests: the handler runs when it registers after a configuration was applied, it does not run when no configuration has arrived, and a throwing handler does not propagate out of registration.Other details
Both changes address FFL-2468. The remaining half of that ticket, the
InitializeAsyncwait, is already on master via #9044. Together with this PR the next release carries the complete fix.