-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[release/7.0] Ensure that OptionsCache only permits creating a single options instance per name #80150
Conversation
…nce per name. This incurs an extra delegate allocation, but only on instance creation. fix #79529
Tagging subscribers to this area: @dotnet/area-extensions-options Issue DetailsBackport of #79639 to release/7.0 Customer ImpactTestingRiskIMPORTANT: Is this backport for a servicing release? If so and this change touches code that ships in a NuGet package, please make certain that you have added any necessary package authoring and gotten it explicitly reviewed.
|
Approved offline by @SteveMCarroll through the email. |
Approved by Tactics (7.0.3). |
@tarekgh : would you know when the hotfix will be available (publicly)? |
@jmprieur - According to the official .NET servicing calendar, the February Release will be published on February 14th. |
Fixes #79529
Backport of #79639 to release/7.0
/cc @tarekgh @madelson
Customer Impact
When apps/services create multiple instances of
IOptionsMonitor<TestOptions>
concurrently at the starting time, it is possible to cause problems like throwing exceptionSystem.InvalidOperationException: Collection was modified; enumeration operation may not execute.
which cause the app or the service to fail to load or run. Such failure is reported from Azure AD in the issue AzureAD/microsoft-identity-web#1995. This is a regression from .NET 6.0 as a side effect of the change #79639.Testing
Added a regression test simulated the exact scenario and validated the desired behavior. Also, the change passed when running all regression tests.
Risk
Low, we didn't change any logic more than not calling the configuration callbacks when creating the entries cache and delay calling it after populating the cache and then calling it once.