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

Fix concurrency issue in TypeDescriptor GetProperties() and GetConverter() #96846

Merged
merged 19 commits into from
Jan 12, 2024

Conversation

steveharter
Copy link
Member

@steveharter steveharter commented Jan 11, 2024

Fixes #92394
Fixes #30024

Replaces (and is derived from the same branch as) PR #92521 in order to apply the "sentinel" pattern so that we don't need a new Hashtable instance. Thanks karakasa and Maximys for your work on this.

karakasa and others added 15 commits September 23, 2023 15:57
Originally a race condition exists in `CheckDefaultProvider` and leads
to wrong results when many methods are called simultaneously.

The PR fixes that by extending the lock statement.

Fix dotnet#92934
to wrong results when many methods are called simultaneously.

The PR fixes that by extending the lock statement.

Fix dotnet#92394
Moved tests to the main testing file
Adopted tests from dotnet#85156

Co-authored-by: Maximys <mixim33@yandex.ru>
ConcurrentGetProperties_ReturnsExpected
is skipped on browsers because Thread.Start
is unsupported.
@ghost
Copy link

ghost commented Jan 11, 2024

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

Issue Details

Fixes #92394
Fixes #30024

Replaces (and is derived from the same branch as) PR #92548 in order to apply the "sentinel" pattern so that we don't need a new Hashtable instance. Thanks karakasa and Maximys for your work on this.

Author: steveharter
Assignees: steveharter
Labels:

area-System.ComponentModel

Milestone: -

Copy link
Member

@ericstj ericstj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, just one functional suggestion.

Copy link
Member

@ericstj ericstj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. For those tests - assume you saw them failing before the fix and confirmed the fix fixes them?

@steveharter
Copy link
Member Author

This looks good to me. For those tests - assume you saw them failing before the fix and confirmed the fix fixes them?

Yes, I reverted the changes from the previous PR and the 3 new tests failed. Then I added back the changes and the tests passed.

@steveharter steveharter merged commit 54530c7 into dotnet:main Jan 12, 2024
111 checks passed
@steveharter steveharter deleted the issue-92394-v2 branch January 12, 2024 15:43
@cincuranet
Copy link
Contributor

tmds pushed a commit to tmds/runtime that referenced this pull request Jan 23, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants