You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand that AWX is open source software provided for free and that I might not receive a timely response.
I am NOT reporting a (potential) security vulnerability. (These should be emailed to [email protected] instead.)
Bug Summary
The documentation states the following:
Jobs are scheduled in UTC. Repeating jobs that run at a specific time of day may move relative to a local timezone when Daylight Savings Time shifts occur. The system resolves the local time zone based time to UTC when the schedule is saved. To ensure your schedules are correctly set, you should set your schedules in UTC time.
But I think this is misleading because the scheduler actually follows DST transitions. What happens according to my understanding:
Since dateutil.rrule is DST aware, jobs scheduled in local time zones should not move relative to a local timezone but relative to UTC time.
Example:
#rrule.pyfromdateutil.rruleimportrrule, MONTHLYfromdateutil.tzimportgettzfromdatetimeimportdatetime# Define the timezonetz=gettz('America/Chicago')
# Define the start datestart_date=datetime(2023, 1, 1, 9, 0, tzinfo=tz)
# Define the rrule for monthly occurrences at 9 AM Central US timerule=rrule(freq=MONTHLY, dtstart=start_date, count=12)
# Calculate all occurrences and convert them to UTCoccurrences_utc= [(dt, dt.astimezone(datetime.now().astimezone().tzinfo)) fordtinrule]
foroccurenceinoccurrences_utc:
print(occurence)
I also scheduled such a job with Ansible Automation Hub 4.5.2 to confirm that it honors DST transitions and it did. We wanted to use AAP for business logic scheduling and in this use case it was important for us that the job run precisely at the same time in local time throughout the year.
AWX version
2.4 Ansible Automation Platform
Select the relevant components
UI
UI (tech preview)
API
Docs
Collection
CLI
Other
Installation method
openshift
Modifications
no
Ansible version
2.15
Operating system
No response
Web browser
No response
Steps to reproduce
Enter a monthly schedule that runs in a local timezone
Wait for DST transition in that timezone
Expected results
According to the documentation the job should shift relative to the local time zone.
Actual results
The job shifts relative to UTC time zone after the DST transition. But it runs correctly in the local time zone throughout the year.
Additional information
No response
The text was updated successfully, but these errors were encountered:
Please confirm the following
[email protected]
instead.)Bug Summary
The documentation states the following:
But I think this is misleading because the scheduler actually follows DST transitions. What happens according to my understanding:
update_computed_fields_no_save
the next occurence of the rrule string is calculated after UTC now(). https://github.com/ansible/awx/blob/devel/awx/main/models/schedules.py#L276Since dateutil.rrule is DST aware, jobs scheduled in local time zones should not move relative to a local timezone but relative to UTC time.
Example:
python3 rrule.py:
I also scheduled such a job with Ansible Automation Hub 4.5.2 to confirm that it honors DST transitions and it did. We wanted to use AAP for business logic scheduling and in this use case it was important for us that the job run precisely at the same time in local time throughout the year.
AWX version
2.4 Ansible Automation Platform
Select the relevant components
Installation method
openshift
Modifications
no
Ansible version
2.15
Operating system
No response
Web browser
No response
Steps to reproduce
Expected results
According to the documentation the job should shift relative to the local time zone.
Actual results
The job shifts relative to UTC time zone after the DST transition. But it runs correctly in the local time zone throughout the year.
Additional information
No response
The text was updated successfully, but these errors were encountered: