kagkarlsson / db-scheduler

Persistent cluster-friendly scheduler for Java
Apache License 2.0
1.23k stars 188 forks source link

fix: Avoid false warning about UTC timestamps #505

Closed GeorgEchterling closed 2 months ago

GeorgEchterling commented 2 months ago

If the JDBC customization is already correctly configured, SchedulerClient.Builder.build should not instantiate an unused incorrectly configured one.

Fixes

Instantiating a SchedulerClient on MariaDB always logged the UTC warning, even when using a correctly configured JDBC customization:

SchedulerClient.Builder.create(dataSource)
            .jdbcCustomization(AutodetectJdbcCustomization(dataSource, true))
            .build()
2024-06-21T15:44:33.427+02:00  WARN 57277 --- [  restartedMain] c.g.k.s.j.A.utc_warning                  : MariaDB-schema does not support persistent timezones. It is recommended to store time in UTC to avoid issues with for example DST. For first time users, use setting 'alwaysPersistTimestampInUtc' to achieve this. Users upgrading from a version prior to v14.0.0 can either silence this logger, or perform a controlled upgrade to UTC timestamps. All old instances of the scheduler must be stopped and timestamps migrated to UTC before starting again, using 'alwaysPersistTimestampInUtc=true'.

(I did not create a separate issue for this.)


cc @kagkarlsson

kagkarlsson commented 2 months ago

Ah, nice catch 👍. Thank you for fixing

kagkarlsson commented 2 months ago

🎉 This issue has been resolved in v14.0.2 (Release Notes)