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

[release/6.0] Fix Time Zone when running with Globalization Invariant Mode #59727

Merged
merged 4 commits into from
Sep 29, 2021

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 28, 2021

Backport of #59710 to release/6.0

Fixes #59636

/cc @tarekgh

Customer Impact

When enabling the globalization invariant mode on Linux, we'll always fallback to UTC time zone which is wrong and a regression from .NET 5.0. We have some docker containers (e.g. Alpine) which enable the globalization invariant mode by default on the whole image; the problem will be obvious there.

In .NET 6.0 we have introduced the Globalization Invariant Mode Breaking Change. This breaking change causes throwing exception when enabling the globalization invariant mode and creating any culture other than Invariant culture.
If the globalization invariant mode is enabled and trying to get the local time zone when running on Linux platform, the creation process will try to initialize the display names of the time zone. This initialization tries to reset the UI culture to en-US if it is set to Invariant culture. When we have the globalization invariant mode is on, the UI culture will always be Invariant and cause the time zone initialization to fallback to en-US which will throw exception because it is not allowed to create any other cultures in the Invariant mode. We catch the exception and then fallback to use UTC time zone instead of the actual time zone set on the running machine.

Testing

Manually tested, added a test to fill the gap in testing time zone with the globalization invariant mode, and passing the regression tests and CI run on main branch.

Risk

Low as not changing any logic more than checking for invariant mode and avoid try creating cultures which cause exception throwing. We are back to .NET 5.0 behavior.

@ghost
Copy link

ghost commented Sep 28, 2021

Tagging subscribers to this area: @tarekgh, @safern
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #59710 to release/6.0

/cc @tarekgh

Customer Impact

Testing

Risk

Author: github-actions[bot]
Assignees: -
Labels:

area-System.Globalization

Milestone: -

@ghost
Copy link

ghost commented Sep 28, 2021

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

Issue Details

Backport of #59710 to release/6.0

/cc @tarekgh

Customer Impact

Testing

Risk

Author: github-actions[bot]
Assignees: tarekgh
Labels:

area-System.Runtime

Milestone: -

@tarekgh tarekgh added this to the 6.0.0 milestone Sep 28, 2021
@tarekgh tarekgh added the Servicing-consider Issue for next servicing release review label Sep 28, 2021
@danmoseley danmoseley added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Sep 28, 2021
@tarekgh
Copy link
Member

tarekgh commented Sep 29, 2021

The failure in Build Browser wasm Release AllSubsets_Mono is unrelated and tracked by the issue #59736

@tarekgh
Copy link
Member

tarekgh commented Sep 29, 2021

@Anipik @ericstj @danmoseley looks I don't have permission to merge it. could you please help merging it? thanks!

@safern safern merged commit 9e0a252 into release/6.0 Sep 29, 2021
@safern safern deleted the backport/pr-59710-to-release/6.0 branch September 29, 2021 04:54
@safern
Copy link
Member

safern commented Sep 29, 2021

@tarekgh done!

@tarekgh
Copy link
Member

tarekgh commented Sep 29, 2021

Thanks @safern

@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Runtime Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants