-
Notifications
You must be signed in to change notification settings - Fork 22
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
Incorrect cron calculation in croniter when DST changed #7
Comments
Isn't that more related to https://github.com/kiorky/croniter ? |
Oh no, didn't look at your patch. Nice one. |
IMO it is more related to |
Incorrect cron calculation in croniter when DST changed #7
I noticed today in the morning that after the DST change tonight aiocron fired at the wrong times, and continued to do so. This issue is still open, although #8 has been merged, so I wonder if the behaviour I observed is a new issue, or if this one has not been fully fixed yet. I am using aiocron version 1.3 on python 3.5 with dateutil version 2.5.3. |
I did some tests with a small test script and noticed a very interesting behaviour:
Notice how a different job fires whether I start at 1:59:55 or 1:58:55.
Both machines are set to CEST. EDIT: This however is inconsistent with what I saw tonight at a production machine (first machine above) where jobs kept on being run at the wrong time. EDIT2: If I think about it more thoroughly, it actually is consistent with what I have observed before. If I start the application early enough, only the job at 2 is executed but the job at 3 not. If I add more jobs at 02:01 and 03:01, only the job scheduled at 02:01 is executed but not the one at 03:01. |
It the last time that this may occurs AFAIK. We'll never change again (at least in UE) |
We've just hit this today 😭 . Wasn't this fixed by: taichino/croniter#135? With |
Looks like it was'nt. Just like UE laws :D I really don't want to dig into this since those hour changes should disappear at some point... Next year? Of course I'll be happy if someone provide a PR if the problem come from aiocron |
|
Indeed, this also hit us (just for fun, tasks schedule on the minute, simply went haywire flooding the logging system with nonsense) - it's unfortunate we don't have a fix as, beyond the EU, many other countries still suffer from the (useless) DST disease. |
Looks like DST will no longer change after November 2023 ? |
The bug still exists in version 1.8 is persistent even after multiple runs. So, my cron job is scheduled at 7:15 but since the DST change it was executed twice at 8:15… Probably, I'll have to restart the service. |
Apparently, it's still a bug in croniter: corpusops/croniter#91 |
As a workaround, set the timezone explicitly using pytz. |
Croniter
incorrectly calculate next cron hit if DST change occurs.The reason is giving
dateutil.tz.tzlocal
object in initial datetime. You can read criticsm about here http://www.assert.cc/2014/05/25/which-python-time-zone-library.html.I have already fixed this issue and I added proper test case.
Env: Ubuntu 14.04
The text was updated successfully, but these errors were encountered: