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

Unexpected Feature Flags refresh behaviour for 6.0.1 #454

Open
danyltsiv opened this issue Aug 31, 2023 · 3 comments
Open

Unexpected Feature Flags refresh behaviour for 6.0.1 #454

danyltsiv opened this issue Aug 31, 2023 · 3 comments

Comments

@danyltsiv
Copy link

danyltsiv commented Aug 31, 2023

When we upgrade AppConfiguration package from 5.1.0 to 6.0.1 for ASP.NET Core app it starts working very unexpectedly in terms of Feature Flags refresh.
With feature flags setup like this:
Feature1 (label=null): true
Feature1 (label=env1): false
In env1, once the app starts all works correctly and we get FALSE, until the first refresh happens, then the non-labeled value overrides the labeled and since then we always get TRUE.
This does not happen on 5.1.0.

Setup code:

configurationBuilder.AddAzureAppConfiguration(options =>
            {
                options.Connect(appConfigUrl);

                // Since Azure App Configuration API allows to load values filtering by 5 keys max,
                // there are a bunch of configuration providers registered, every of it loads next portion of 5 values
                foreach (var keysString in keysStrings)
                {
                    options
                        .Select(keysString)
                        .Select(keysString, label);
                }

                options
                    .ConfigureKeyVault(vaultOptions =>
                    {
                        vaultOptions.SetCredential(credentials);
                    })
                    .ConfigureRefresh(refresh =>
                    {
                        refresh
                            .Register(sentinelKey, label, true)
                            .SetCacheExpiration(TimeSpan.FromSeconds(reloadInterval));
                    })
                    .UseFeatureFlags(featureFlagsOptions =>
                    {
                        featureFlagsOptions
                            .Select(KeyFilter.Any)
                            .Select(KeyFilter.Any, label);

                        featureFlagsOptions.CacheExpirationInterval = TimeSpan.FromSeconds(reloadInterval);
                    });
            });

Also, worth mentioning that we call UseAzureAppConfiguration at the beginning of Startup.cs, so that we don't have issues like here: microsoft/FeatureManagement-Dotnet#201 (at some point we had, but fixed by moving it to top as well).

This happens with no interaction with Feature Flags on portal, so seems like no relations to #317

@amerjusupovic
Copy link
Member

Hi @danyltsiv, the bug in #317 shouldn't be exclusive to those who use the portal. From what you described, the pull request linked in that issue (#404) should resolve this issue as well. I can look more into why this happened while upgrading from 5.1.0 to see if there's anything you can do to work around this at the moment, but this should be fixed in the next major release.

@zhiyuanliang-ms
Copy link
Contributor

@amerjusupovic Has the bug been fixed now? Is it safe to close this issue?

@amerjusupovic
Copy link
Member

The team couldn't come to an agreement on the approach in the original PR I mentioned, and the newest PR to add collection monitoring for key-values here should solve this. I can probably close #404 once the new PR I mentioned gets further along.

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

3 participants