Open kkujawinski opened 6 years ago
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 dateutil.tz.tzlocal
. Check the article I've pasted.
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:
$ faketime '2020-03-29 1:58:55' ./aiocron-test.py
start running at: 2020-03-29T01:58:55.439818+01:00
fired 59 1 * * * 59 at 2020-03-29T01:59:59.024419+01:00
fired 0 2 * * * at 2020-03-29T03:00:00.002449+02:00
$ faketime '2020-03-29 1:59:55' ./aiocron-test.py
start running at: 2020-03-29T01:59:55.687915+01:00
fired 59 1 * * * 59 at 2020-03-29T01:59:59.003210+01:00
fired 0 3 * * * at 2020-03-29T03:00:00.002315+02:00
Notice how a different job fires whether I start at 1:59:55 or 1:58:55. I could reproduce that on two machines with different versions:
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: https://github.com/taichino/croniter/pull/135? With croniter==1.0.15
also happens.
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
I really don't want to dig into this since those hour changes should disappear at some point... Next year? That's what I'm looking for, too. Until then, I just have a reminder in my calendar to restart things after the DST change…
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 ?
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