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

Make the callsite cache more thread safe #52691

Merged
merged 2 commits into from
May 13, 2021

Conversation

davidfowl
Copy link
Member

  • Previously we would create duplicate callsites and because they weren't used to for anything critical, now we're using them as a lock per type and slot and to store singleton values cheaply. This means we need to make sure they are unique. Duplicates were being created in situations where there were connected graphs and lots of concurrency because there was no lock to ensure that only a single type would be processed at a time. This change adds that lock and adds tests.

Found in dotnet/efcore#24861

- Previously we would create duplicate callsites and because they weren't used to for anything critical, now we're using them as a lock per type and slot and to store singleton values cheaply. This means we need to make sure they are unique. Duplicates were being created in situations where there were connected graphs and lots of concurrency because there was no lock to ensure that only a single type would be processed at a time. This change adds that lock and adds tests.
@ghost
Copy link

ghost commented May 13, 2021

Tagging subscribers to this area: @eerhardt, @maryamariyan
See info in area-owners.md if you want to be subscribed.

Issue Details
  • Previously we would create duplicate callsites and because they weren't used to for anything critical, now we're using them as a lock per type and slot and to store singleton values cheaply. This means we need to make sure they are unique. Duplicates were being created in situations where there were connected graphs and lots of concurrency because there was no lock to ensure that only a single type would be processed at a time. This change adds that lock and adds tests.

Found in dotnet/efcore#24861

Author: davidfowl
Assignees: -
Labels:

area-Extensions-DependencyInjection

Milestone: -

@davidfowl davidfowl merged commit a1517c5 into main May 13, 2021
@eerhardt eerhardt deleted the davidfowl/threadsafe-callsite-cache branch May 13, 2021 21:37
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jun 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants