Possible exception on configuration reload - Collection was modified; enumeration operation may not execute. #704
Labels
Component/Configuration
Issues related to Configuration providers
ReleaseLine/2.x
Identified as a feature/fix for the 2.x release line
ReleaseLine/3.x
Identified as a feature/fix for the 3.x release line
Type/bug
Something isn't working
Describe the bug
I'm currently researching an invalid operation exception in an application when binding configuration. I haven't conclusively narrowed it down but my research so far raises concern for how the ConfigServerConfigurationProvider is implemented. This application is using env variables, cloud foundry configuration and config server configuration providers.
Based on changes made in the framework configuration providers (i.e. dotnet/extensions#1202), and seeing that the
AddConfigServerClientSettings
method inConfigServerConfigurationProvider
is directly changing theData
dictionary, I believe there is the potential that a configuration reload() could result in an InvalidOperationException.To my knowledge, we're not calling Reload() on configuration when this is being encountered, but I thought it best to let you know that there may be an issue with how this is implemented: https://github.com/SteeltoeOSS/Steeltoe/blob/main/src/Configuration/src/ConfigServerBase/ConfigServerConfigurationProvider.cs#L422
Expected behavior
I would expect a call to reload configuration would not throw an invalid operation exception because a collection has been modified.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: