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

time: Europe/Dublin timezone handling broken with embedded timezone database [1.16 backport] #45385

Closed
gopherbot opened this issue Apr 4, 2021 · 4 comments
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Milestone

Comments

@gopherbot
Copy link

@ianlancetaylor requested issue #45370 to be considered for backport to the next 1.16 minor release.

@gopherbot Please open a backport issue.

This issue will cause incorrect timezone information to be used on systems using the slim tzdata format, which are increasingly likely as it is now the default.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Apr 4, 2021
@gopherbot gopherbot added this to the Go1.16.4 milestone Apr 4, 2021
@gopherbot
Copy link
Author

Change https://golang.org/cl/307210 mentions this issue: [release-branch.go1.16] time: add Time.IsDST() to check if its Location is in Daylight Savings Time

@gopherbot
Copy link
Author

Change https://golang.org/cl/307211 mentions this issue: [release-branch.go1.16] time: use offset and isDST when caching zone from extend string

@dmitshur
Copy link
Contributor

dmitshur commented Apr 8, 2021

Approving per discussion in a release meeting. This backport applies to both 1.16 (this issue) and 1.15 (#45384).

@dmitshur dmitshur added CherryPickApproved Used during the release process for point releases and removed CherryPickCandidate Used during the release process for point releases labels Apr 8, 2021
@gopherbot
Copy link
Author

Closed by merging f12cf76 to release-branch.go1.16.

gopherbot pushed a commit that referenced this issue Apr 12, 2021
…from extend string

If the current time is computed from extend string
and the zone file contains multiple zones with the
same name, the lookup by name might find incorrect
zone.

This happens for example with the slim Europe/Dublin
time zone file in the embedded zip. This zone file
has last transition in 1996 and rest is covered by
extend string.
tzset returns IST as the zone name to use, but there
are two records with IST name. Lookup by name finds
the wrong one. We need to check offset and isDST too.

In case we can't find an existing zone, we allocate
a new zone so that we use correct offset and isDST.

I have renamed zone variable to zones as it shadowed
the zone type that we need to allocate the cached zone.

Backport note: this change also incorporates portions of
CL 264077.

For #45370
Fixes #45385

Change-Id: If7a0cccc1908e27f0509bf422d824133133250fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/307211
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
@golang golang locked and limited conversation to collaborators Apr 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

2 participants