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

[release/7.0] Ensure that OptionsCache only permits creating a single options instance per name #80150

Merged
merged 3 commits into from
Jan 4, 2023

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jan 3, 2023

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 exception System.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.

…nce per name.

This incurs an extra delegate allocation, but only on instance creation.

fix #79529
@ghost
Copy link

ghost commented Jan 3, 2023

Tagging subscribers to this area: @dotnet/area-extensions-options
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #79639 to release/7.0

/cc @tarekgh @madelson

Customer Impact

Testing

Risk

IMPORTANT: 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.

Author: github-actions[bot]
Assignees: -
Labels:

area-Extensions-Options

Milestone: -

@tarekgh tarekgh added this to the 7.0.x milestone Jan 3, 2023
@tarekgh tarekgh added the Servicing-consider Issue for next servicing release review label Jan 3, 2023
@tarekgh tarekgh self-assigned this Jan 3, 2023
@tarekgh tarekgh added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jan 4, 2023
@tarekgh
Copy link
Member

tarekgh commented Jan 4, 2023

Approved offline by @SteveMCarroll through the email.

@carlossanlop carlossanlop modified the milestones: 7.0.x, 7.0.3 Jan 4, 2023
@carlossanlop
Copy link
Member

Approved by Tactics (7.0.3).
Signed off by area owner.
Required OOB changes look correct.
CI failure is known/unrelated/already fixed: #78778
Ready to merge. :shipit:

@carlossanlop carlossanlop merged commit a790868 into release/7.0 Jan 4, 2023
@carlossanlop carlossanlop deleted the backport/pr-79639-to-release/7.0 branch January 4, 2023 22:35
@jmprieur
Copy link

jmprieur commented Jan 5, 2023

@tarekgh : would you know when the hotfix will be available (publicly)?

@carlossanlop
Copy link
Member

carlossanlop commented Jan 5, 2023

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.

@ghost ghost locked as resolved and limited conversation to collaborators Feb 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Extensions-Options Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants