microsoft / service-fabric-aspnetcore

This repo contains ASP.NET Core integration for Service Fabric Reliable Services.
Other
152 stars 49 forks source link

ServiceFabricConfigurationProvider loads configuration from the wrong package when a ConfigurationPackageModifiedEvent is raised #93

Closed hfaran closed 3 years ago

hfaran commented 3 years ago

Describe the bug

ServiceFabricConfigurationProvider does not handle configuration updates correctly when multiple ConfigPackages are used. The event handler for the ConfigurationPackageModifiedEvent and the ConfigurationPackageAddedEvent should only load configuration from the provided package if it matches the package name that that provider maps to. Today, this does not happen so every provider ends up loading config from any other package if there is a config update for that package.

To Reproduce This can be reproduced by triggering a config update when more than one ConfigPackages are present. (A test for this is also added in the PR to fix this bug, see: https://github.com/microsoft/service-fabric-aspnetcore/pull/94/files#diff-95ac8934aadab47749fa06eefaccba08ad9b65b33a958b1cf233326aea59616f).

Expected behavior ServiceFabricConfigurationProvider should only load from the ConfigPackage to which it is mapped, and not other packages.