This repository was archived by the owner on Jan 23, 2023. It is now read-only.
[release/3.1] Port dotnet/runtime#32104 fix for Thread.CurrentPrincipal regression#42860
Merged
Anipik merged 1 commit intoFeb 18, 2020
Conversation
Member
|
This fix is in CoreLib so it needs to be submitted to https://github.com/dotnet/coreclr repo first. |
Member
Author
|
Ah, almost forgot about the duplication there :-) |
Member
Author
|
Referencing dotnet/runtime#32104 |
jkotas
approved these changes
Feb 18, 2020
* fix principal policy for new threads Fixes #31717
424ddbe to
ecc3c0e
Compare
Member
|
Approved, please get CR and CI green and @Anipik will merge (I believe deadline is end of day) |
|
@jkotas can you take a final look at the change ? |
jkotas
approved these changes
Feb 18, 2020
Member
Author
|
Shouldn't the coreclr fix be merged first? |
Will the coreclr change fail the new tests ? |
Member
|
Yes, the new test will fail without the CoreCLR change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Backports a fix for issue dotnet/runtime#31717 which concerns a regression in the behaviour of the
Thread.CurrentPrincipalproperty, introduced in 3.0.This has already been fixed in .NET 5 (see dotnet/runtime#32104). This PR ports that fix down to release/3.1.
Customer Impact
Assigning a PrincipalPolicy to the current AppDomain results in the first thread correctly returning
Thread.CurrentPrincipal. However it will consistently returnnullfor any subsequent threads. There are no known workarounds to this issue.Regression?
Functional regression between 2.1 and 3.0. Reported by 2 customers.
Testing
The .NET 5 fix at dotnet/runtime#32104 includes tests for the fix.
Risk
Moderate. The regression was introduced in an attempt to introduce new behaviour (i.e. flowing the principal with ExecutionContext), but this was broken in all but the most trivial scenaria (using just one thread). It is conceivable that fixing this might expose other problems, or in the very least break applications written against 3.0 that implicitly depend on the current behaviour of the property.
Code Reviewer
@jkotas