Repository navigation
Keep the metrics ping's last-sent day stable across DST changes - #3733
Open
rvandermeulen wants to merge 1 commit into
Open
rvandermeulen wants to merge 1 commit into
rvandermeulen wants to merge 1 commit into
Conversation
This branch has not been deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
getISOTimeString(truncateTo = DAY)wrote today's date with the offset in effect at the time of the call, and parsing that string gives midnight at that offset. When the offset changed later in the day (DST starting after midnight) or local midnight was skipped (DST starting at 00:00, as in Egypt, Chile, Cuba, Lebanon and the Azores), the string parsed back to the previous day.MetricsPingSchedulerstores the metrics ping's last-sent date this way and checks it withDateUtils.isToday, so on those days a restart after the due time sent a second metrics ping.Day strings now format the start of the local day with the offset that makes it read 00:00, so they always parse back to that day. The round-trip test now pins the time zone and uses fixed DST transition dates in several zones instead of the current date, which made it fail on DST-change days.
I found this when
DateUtilsTestfailed in local runs of #3732's tests today (2026-11-01, the day US DST ended) in America/New_York, on both JDK 17 and JDK 25; it passed withTZ=UTC. The DAY case formatted2026-11-01-05:00, which parses back to 01:00 EDT, and formatting that again gave2026-11-01-04:00. On a fall-back day the parsed date stays on the right day, so only the test's string comparison failed. The wrong-day case that sends the extra metrics ping happens on spring-forward days, which the new test covers. CI on #3732 didn't hit the failure.