Repository navigation
fix(health): resolve SYSTEM time_zone and skip check on 6.7 - #479
Merged
Merged
Conversation
Contributor
|
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
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.
1. Why is this change necessary?
The
sql_time_zonehealth check compares@@time_zonewith+00:00andUTConly. It has two problems:time_zone = SYSTEM(the server default), the check warns even when the host itself runs in UTC. On Shopware 6.6 this happens as soon asSQL_SET_DEFAULT_SESSION_VARIABLES=0is set, which is the setup thesql_set_default_session_variablesrecommendation asks for.MySQLFactoryalways runsSET @@session.time_zone = '+00:00'on connect. Read through Shopware's connection,@@time_zoneis therefore always+00:00, so the check can never fire there.2. What does this change do, exactly?
MysqlSettingsChecker::checkTimeZone()returns early on Shopware >= 6.7, using the same version gate ascheckCheckDefaultEnvironmentSessionVariables().@@time_zoneand@@system_time_zonetogether. A value ofSYSTEMis resolved to the host time zone before the comparison, and the warning shows both, e.g.SYSTEM (CEST).Etc/UTCis added toMysqlSettingsChecker::MYSQL_TIME_ZONES.sql_time_zonerecommendation text now says "(Relevant before Shopware 6.7.)", like thesql_set_default_session_variablesone.@@system_time_zoneis an abbreviation, so a host that reportsGMTstill gets the warning.3. Describe each step to reproduce the issue or behaviour.
Setup: Shopware 6.6 with
SQL_SET_DEFAULT_SESSION_VARIABLES=0, nodefault-time-zonein the MySQL config (so@@time_zoneisSYSTEM), and the MySQL host running in UTC (SELECT @@system_time_zonereturnsUTC).SYSTEM.TZ=Europe/Berlin) and restart MySQL. After: the warning showsSYSTEM (CEST).