Fix concurrency issue in TypeDescriptor GetProperties() and GetConverter()#96846
Fix concurrency issue in TypeDescriptor GetProperties() and GetConverter()#96846steveharter merged 19 commits intodotnet:mainfrom
Conversation
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 <[email protected]>
ConcurrentGetProperties_ReturnsExpected is skipped on browsers because Thread.Start is unsupported.
|
Tagging subscribers to this area: @dotnet/area-system-componentmodel Issue DetailsReplaces (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.
|
src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs
Outdated
Show resolved
Hide resolved
ericstj
left a comment
There was a problem hiding this comment.
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. |
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.