[release/8.0-staging] TypeDescriptor threading fixes #101305
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #96846 and #97236 to release/8.0-staging.
The 6.0 backport is at #101306.
Customer Impact
See issues #92394 and #30024.
There is a threading issue corrupts internal caches, causing various
TypeDescriptor
methods to return incorrect information. The most likely time it would occur is during warm-up when there are several concurrent threads using variousTypeDescriptor
static methods.Technical details
The locking behavior was not correct for multiple threads. Various analysis at:
Regression
No, it appears to have existed in .NET Framework before being ported to .NET Core.
Testing
Previous PR attempts added tests which were ported. Additional tests added for deadlock cases. In addition, the fixes were successfully applied to a .NET Framework local build which was tested by an external customer reporting these issues. It is expected to be ported to .NET framework as well.
The fixes were in v9.0 around 4 months ago with no issues reported.
Risk
Low, as noted there have been no regressions notes in the last 4 months.