Bug #30371
closedSync plan time handling still doesn't behave as expected
Description
I know that some work has been done to fix the time "weirdness" around sync plans and that it stems from originally not storing timezone info, but there is still a lot of weirdness w/ Sync plan times...
Background¶
Katello: 3.15.2
Foreman: 2.0.1
Server Timezone: Arizona/Phoenix (MST UTC-0700)
Foreman User Profile Timezone: Browser timezone
My Browser Timezone: America/Denver (MDT UTC-0600)
Summary¶
This all started from setting a Sync plan up like:
$ hammer sync-plan update --name Daily --interval daily --sync-date 2011-06-12T03:05:00MST
I expected that to run last night at 03:05AM MDT but it instead ran at 09:05 MDT.
So lets see what hammer thinks about the next run.
$ hammer sync-plan update --name Daily --interval daily --sync-date 2011-06-12T03:05:00MST Sync plan updated. $ hammer sync-plan info --name Daily | grep Next Next Sync: 2020/07/11 10:05:00
(in UI) Next Sync: July 11, 2020, 04:05 AM
I suspect it'll run at 09:05:00 AM July 11 MDT.
It got even weirder when I tried to use cron schedules...
hammer + cron¶
$ hammer sync-plan update --name Daily --interval custom\ cron --cron-expression '05 03 * * *' Sync plan updated. $ hammer sync-plan info --name Daily | grep Next Next Sync: 2020/07/11 03:05:00
UI Shows Next Sync: July 10, 2020, 09:05 PM
UI + cron¶
Note: 03:06 because just saving "05 03 * * *" again doesn't cause a change
(in UI) Interval: Custom Cron
(in UI) Cron Expression: 06 03 * * *
(in UI) <SAVE>
(in UI) Next Sync: July 11, 2020, 03:06 AM
Ok, lets check hammer.
$ hammer sync-plan info --name Daily | grep Next Next Sync: 2020/07/11 09:06:00
Fine, go back to interval "daily" + sync date¶
hammer sync-plan update --name Daily --interval daily --sync-date 2011-06-12T03:05:00MST Sync plan updated. $ hammer sync-plan info --name Daily | grep Next Next Sync: 2020/07/11 10:05:00
(in UI) Next Sync: July 11, 2020, 04:05 AM
Thoughts¶
I could go on, I did a bunch more tests. More combinations of cron, setting the date at 2011-06-12T03:05:00 with and without timezone using hammer in the UI and on and on.
Expected behavior¶
I guess as a user what I expect is something like the following.
- Browser should show Next sync in my Browser's timezone or the one in my preferences.
- Hammer should show Next sync in my shell's timezone
- Cron expressions should ALWAYS be evaluated in the context of the server's timezone, that is the TZ of the process running katello.
Possible improvements¶
UI
- Show both browser time and server time (as calculated by the process running katello) in the UI
- If the user's timezone is NOT "Browser timezone" indicate that in the UI "from preferences" or something
- When entering time on the UI allow the user to choose "server time" or "local time" (browser time or preferred time)
Hammer
- Show both shell and server time in the "info" view, use UTC everywhere else (CSV)
- Be clear about TZ in --sync-date parameter, if no TZ provided then server timezone
- Document 'custom cron' is in the server's timezone
Updated by Jonathon Turel over 4 years ago
- Category set to Sync Plans
- Target version set to Katello 4.0.0
- Triaged changed from No to Yes
Updated by Chris Roberts over 4 years ago
- Target version changed from Katello 4.0.0 to Katello 3.17.0
Updated by Samir Jha about 4 years ago
I was thinking about this:
UI
Show both browser time and server time (as calculated by the process running katello) in the UI
When entering time on the UI allow the user to choose "server time" or "local time" (browser time or preferred time)
Since the UI is accessible to everyone outside the server, would it be confusing to show the server time on the UI? We could possibly add the timezone information to the sync plan info page to make it more obvious.
If the user's timezone is NOT "Browser timezone" indicate that in the UI "from preferences" or something
Displaying timezone as an uneditable field on the sync plan info page might help with this. Or an info section displaying the timezone and instructions to update the user timezone if needed?
Thoughts?
Hammer:
I did find the hammer timezones a little confusing until I realized everything on hammer is displayed in UTC. The improvements below should help with that in my understanding.
Show both shell and server time in the "info" view, use UTC everywhere else (CSV)
+1
Be clear about TZ in --sync-date parameter, if no TZ provided then server timezone
+1
Document 'custom cron' is in the server's timezone
+1
Updated by The Foreman Bot about 4 years ago
- Status changed from New to Ready For Testing
- Assignee set to Samir Jha
- Pull request https://github.com/Katello/katello/pull/8949 added
Updated by The Foreman Bot about 4 years ago
- Fixed in Releases Katello 4.0.0 added
Updated by Samir Jha about 4 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset katello|5473178806f66149b77df1026f23f1e766ebb1d4.
Updated by The Foreman Bot over 1 year ago
- Pull request https://github.com/Katello/katello/pull/10526 added