This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
[release/3.1] Port dotnet/runtime#32104 fix for Thread.CurrentPrincipal regression #42860
Merged
Anipik
merged 1 commit into
dotnet:release/3.1
from
eiriktsarpalis:backport-appdomain-principal-fix
Feb 18, 2020
Merged
[release/3.1] Port dotnet/runtime#32104 fix for Thread.CurrentPrincipal regression #42860
Anipik
merged 1 commit into
dotnet:release/3.1
from
eiriktsarpalis:backport-appdomain-principal-fix
Feb 18, 2020
Conversation
This file contains 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
This fix is in CoreLib so it needs to be submitted to https://github.com/dotnet/coreclr repo first. |
Ah, almost forgot about the duplication there :-) |
Referencing dotnet/runtime#32104 |
eiriktsarpalis
changed the title
Fix AppDomain.SetPrincipalPolicy bug for new threads (#32104)
[release/3.1] Port dotnet/runtime#32104 fix for Thread.CurrentPrincipal regression
Feb 17, 2020
jkotas
approved these changes
Feb 18, 2020
* fix principal policy for new threads Fixes #31717
eiriktsarpalis
force-pushed
the
backport-appdomain-principal-fix
branch
from
February 18, 2020 11:35
424ddbe
to
ecc3c0e
Compare
danmoseley
added
Servicing-approved
Approved for servicing release
and removed
Servicing-consider
Issue for next servicing release review
labels
Feb 18, 2020
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
Shouldn't the coreclr fix be merged first? |
Will the coreclr change fail the new tests ? |
Yes, the new test will fail without the CoreCLR change. |
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.CurrentPrincipal
property, 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 returnnull
for 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