Skip Menu |

This queue is for tickets about the Schedule-Cron CPAN distribution.

Report information
The Basics
Id: 51051
Status: resolved
Priority: 0/
Queue: Schedule-Cron

People
Owner: roland [...] cpan.org
Requestors: joseph.shin [...] boards2go.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: DST issue
Ran into weird behavior for DST. The cron looked like 0 1 1 * * , but from 1AM - 2AM, the job fired off probably 6,000 times :). I would have expected one of the 2 behaviors identified in the DST section. Any help would be appreciated.
Hi,

On Mon Nov 02 16:21:19 2009, joeshin wrote:
Show quoted text
> Ran into weird behavior for DST. The cron looked like 0 1 1 * * , but
> from 1AM - 2AM, the job fired off probably 6,000 times :). I would have
> expected one of the 2 behaviors identified in the DST section. Any help
> would be appreciated.

sorry for delay, the ticket slipped through somehow (and I didn't received a mail 
in my inbox).

Could you please tell me which version of Schedule::Cron do you use ?

Version 0.99 fixes a serious bug concerning DST. From the man page:
DST ISSUES
       Daylight saving occurs typically twice a year: In the first switch, one hour is skipped. Any job which which triggers in this skipped
       hour will be fired in the next hour. So, when the DST switch goes from 2:00 to 3:00 a job would is scheduled for 2:43, then it will be
       executed at 3:43.

       For the reverse backwards switch later in the year, the behaviour is undefined. Two possible behaviours can occur: For jobs triggered in
       short intervals, where the next execution time would fire in the extra hour as well, the job could be executed again or skipped in this
       extra hour. Currently, running "Schedule::Cron" in "MET" would skip the extra job, in "PST8PDT" it would execute a second time. The rea-
       son is the way how Time::ParseDate calculates epoch times for dates given like "02:50:00 2009/10/25". Should it return the seconds since
       1970 for this time happening 'first', or for this time in the extra hour ? As it turns out, Time::ParseDate returns the epoch time of
       the first occurence for "PST8PDT" and for "MET" it returns the second occurence. Unfortunately, there is no way to specify which entry
       Time::ParseDate should pick (until now). Of course, after all, this is obviously not Time::ParseDate's fault, since a simple date speci-
       fication within the DST backswitch period is ambigious. However, it would be nice if the parsing behaviour of Time::ParseDate would be
       consistent across time zones (a ticket has be raised for fixing this). Then Schedule::Cron's behaviour within a DST backward switch
       would be consistent as well.

       Since changing the internal algorithm which worked now for over ten years would be too risky and I don't see any simple solution for
       this right now, it is likely that this undefined behaviour will exist for some time. Maybe some hero is coming along and will fix this,
       but this is probably not me ;-)

       Sorry for that.

I know, this is not a perfect solution, but at least Schedule::Cron shouldn't run amok anymore. Sorry for any inconvenience.
Please let me know, whether I can close the ticket (which I assume, when you don't veto within the next two weeks ;-)

...roland

From: joseph.shin [...] boards2go.com
Roland,<br /> <br /> We are currently using v1.16.&nbsp; I have read that and it says *some* undefined behavior... but this was unexpected :)&nbsp; I will take some time to think about a solution.<br /> <br /> Thanks,<br /> Joseph Shin<br /> <br /> On Thu Jan 07 06:17:04 2010, ROLAND wrote: <br /> &gt; Hi, <br /> &gt; <br /> &gt; On Mon Nov 02 16:21:19 2009, joeshin wrote: <br /> &gt; &gt; Ran into weird behavior for DST. The cron looked like 0 1 1 * * , <br /> &gt; but <br /> &gt; &gt; from 1AM - 2AM, the job fired off probably 6,000 times :). I would <br /> &gt; have <br /> &gt; &gt; expected one of the 2 behaviors identified in the DST section. Any <br /> &gt; help <br /> &gt; &gt; would be appreciated. <br /> &gt; <br /> &gt; sorry for delay, the ticket slipped through somehow (and I didn't <br /> &gt; received a <br /> &gt; mail <br /> &gt; in my inbox). <br /> &gt; <br /> &gt; Could you please tell me which version of Schedule::Cron do you use ? <br /> &gt; <br /> &gt; Version 0.99 fixes a serious bug concerning DST. From the man page: <br /> &gt; <br /> &gt; DST ISSUES <br /> &gt; Daylight saving occurs typically twice a year: In the first <br /> &gt; switch, one hour is skipped. Any job which which triggers in this <br /> &gt; skipped <br /> &gt; hour will be fired in the next hour. So, when the DST switch <br /> &gt; goes from 2:00 to 3:00 a job would is scheduled for 2:43, then it will <br /> &gt; be <br /> &gt; executed at 3:43. <br /> &gt; <br /> &gt; For the reverse backwards switch later in the year, the <br /> &gt; behaviour is undefined. Two possible behaviours can occur: For jobs <br /> &gt; triggered in <br /> &gt; short intervals, where the next execution time would fire in <br /> &gt; the extra hour as well, the job could be executed again or skipped in <br /> &gt; this <br /> &gt; extra hour. Currently, running &quot;Schedule::Cron&quot; in &quot;MET&quot; would <br /> &gt; skip the extra job, in &quot;PST8PDT&quot; it would execute a second time. The <br /> &gt; rea- <br /> &gt; son is the way how Time::ParseDate calculates epoch times for <br /> &gt; dates given like &quot;02:50:00 2009/10/25&quot;. Should it return the seconds <br /> &gt; since <br /> &gt; 1970 for this time happening 'first', or for this time in the <br /> &gt; extra hour ? As it turns out, Time::ParseDate returns the epoch time <br /> &gt; of <br /> &gt; the first occurence for &quot;PST8PDT&quot; and for &quot;MET&quot; it returns the <br /> &gt; second occurence. Unfortunately, there is no way to specify which <br /> &gt; entry <br /> &gt; Time::ParseDate should pick (until now). Of course, after all, <br /> &gt; this is obviously not Time::ParseDate's fault, since a simple date <br /> &gt; speci- <br /> &gt; fication within the DST backswitch period is ambigious. <br /> &gt; However, it would be nice if the parsing behaviour of Time::ParseDate <br /> &gt; would be <br /> &gt; consistent across time zones (a ticket has be raised for fixing <br /> &gt; this). Then Schedule::Cron's behaviour within a DST backward switch <br /> &gt; would be consistent as well. <br /> &gt; <br /> &gt; Since changing the internal algorithm which worked now for over <br /> &gt; ten years would be too risky and I don't see any simple solution for <br /> &gt; this right now, it is likely that this undefined behaviour will <br /> &gt; exist for some time. Maybe some hero is coming along and will fix <br /> &gt; this, <br /> &gt; but this is probably not me ;-) <br /> &gt; <br /> &gt; Sorry for that. <br /> &gt; <br /> &gt; <br /> &gt; I know, this is not a perfect solution, but at least Schedule::Cron <br /> &gt; shouldn't <br /> &gt; run amok anymore. Sorry for any inconvenience. <br /> &gt; Please let me know, whether I can close the ticket (which I assume, <br /> &gt; when you <br /> &gt; don't veto within the next two weeks ;-) <br /> &gt; <br /> &gt; ...roland <br /> <br /> <br />
From: joseph.shin [...] boards2go.com
wow too early in the morning... we are indeed using v.97 will update to v.99 :)<br />
I released 1.00 this morning.  Do you still have the problem with DST switching ?

Please tell me within the next two weeks, 
whether I can help you out, otherwise I will close this ticket.

thanx ...
...roland

On Thu Jan 07 12:00:46 2010, joeshin wrote:
Show quoted text
> wow too early in the morning... we are indeed using v.97 will update
> to v.99 :)<br />


From: joseph.shin [...] boards2go.com
Roland, Last DST switch all went smooth with version .99 Much appreciated, feel free to close this one :) Joe On Fri May 14 13:29:04 2010, ROLAND wrote: Show quoted text
> I released 1.00 this morning. Do you still have the problem with DST > switching > ? > > Please tell me within the next two weeks, > whether I can help you out, otherwise I will close this ticket. > > thanx ... > ...roland > > On Thu Jan 07 12:00:46 2010, joeshin wrote:
> > wow too early in the morning... we are indeed using v.97 will update > > to v.99 :)<br />
 seems to be fixed.