-
Notifications
You must be signed in to change notification settings - Fork 94
Fix.6701.scheduler time zone change bug #6719
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
base: 8.4.x
Are you sure you want to change the base?
Conversation
6a49f26
to
2ad10fe
Compare
TIME_ZONE_STRING_UTC = "Z" | ||
TIME_ZONE_UTC_UTC_OFFSET = (0, 0) | ||
TIME_ZONE_LOCAL_UTC_OFFSET = get_local_time_zone() | ||
TIME_ZONE_LOCAL_UTC_OFFSET_HOURS = TIME_ZONE_LOCAL_UTC_OFFSET[0] | ||
TIME_ZONE_LOCAL_UTC_OFFSET_MINUTES = TIME_ZONE_LOCAL_UTC_OFFSET[1] | ||
|
||
TIME_ZONE_LOCAL_INFO = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only used in cylc.flow.data_store_mgr.DataStoreMgr.generate_definition_elements
which seems to be for fields which are not updated. @dwsutherland might wish to comment on whether this safe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't think why this information is needed in the data store/GQL API at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the time zone is recorded on the workflow object from TIME_ZONE_LOCAL_INFO
:
cylc-flow/cylc/flow/data_store_mgr.py
Line 697 in d5ac2e2
if get_utc_mode(): |
That will only be reread from TIME_ZONE_LOCAL_INFO
on start/restart and reload...
Does TIME_ZONE_LOCAL_INFO
also get updated on reload?
The job nodes just get passed the time by the events or job manager.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That leads to a real possibility that the time zones in the GUI will be wrong on DST change? I think I should create an "investigate this" ticket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the use case for having in the GraphQL API the local system time zone on scheduler start (except not when the workflow is running in UTC mode)? Note this is not the cycle point time zone
N.B. will conflict with #6640 |
TIME_ZONE_STRING_UTC = "Z" | ||
TIME_ZONE_UTC_UTC_OFFSET = (0, 0) | ||
TIME_ZONE_LOCAL_UTC_OFFSET = get_local_time_zone() | ||
TIME_ZONE_LOCAL_UTC_OFFSET_HOURS = TIME_ZONE_LOCAL_UTC_OFFSET[0] | ||
TIME_ZONE_LOCAL_UTC_OFFSET_MINUTES = TIME_ZONE_LOCAL_UTC_OFFSET[1] | ||
|
||
TIME_ZONE_LOCAL_INFO = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't think why this information is needed in the data store/GQL API at all.
@wxtim Can you please explain the bug in the PR description |
f055f41
to
56be9d1
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Credit to @MetRonnie for working out why Mac was behaving differently: Python on Mac doesn't appear to require |
response to review rewrote test in a less resource intensive way make the set_tz fixture more generic
* Modernise docstring.
ccaf3be
to
1bc013f
Compare
Co-authored-by: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com>
5ad2dfa
to
35d6392
Compare
@hjoliver - Review Poke |
@hjoliver Review poke |
Closes #6701
The first time the scheduler loads
cylc.flow.wallclock
the constantsTIME_ZONE_STRING_LOCAL_BASIC
andTIME_ZONE_STRING_LOCAL_EXTENDED
are populated for the lifetime of the scheduler. This means that the time zone returned byget_time_string
will remain the same, even if the time it adds to the time zone label changes time zone.For example a scheduler started in UK winter will always return
date_time.strftime(date_time_format_string) + 'Z'
. If the clocks subsequently go forward, the time recorded for local time09:00+01:00
will be09:00Z
which is equivelent to10:00+01:00
. The consequence is that the database table will record thetime_submit
field as nearly an hour after thetime_submit_exit
field.This bug is particularly noticable in Cylc Review where the following was observed:
i.e. the task has submitted 22 minutes in the future!
Check List
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
(andconda-environment.yml
if present).?.?.x
branch.