Re: Trriger fires twice during Daylight saving time day

344 views
Skip to first unread message

Andrew Smith

unread,
Nov 3, 2012, 1:43:35 AM11/3/12
to quar...@googlegroups.com
I noticed this too, and it does look like currently it will behave this way.
I did manage to resolve this I believe, I created an issue for it here: https://github.com/quartznet/quartznet/pull/72

if your interested to see what I changed to resolve this particular issue, it's only one line of code in the CronExpression file.
https://github.com/amazing-andrew/quartznet/commit/518a88c35039330198cb5d70b8f602cf241f1a9e#diff-1

Thanks,
~Andrew

On Monday, October 22, 2012 10:38:52 AM UTC-4, ZyZ wrote:
Hello 

Im not sure why but my trigger fires (or at least appears to fire) twice during DST day. My code look like this

var timezone = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time");
var trigger = TriggerBuilder.Create()
                        .WithCronSchedule("0 15 15 * * ?", x => x.InTimeZone(timezone))
                        .WithIdentity("cronName","cronGroup")
                        .UsingJobData("jobName","jobGroup")
                        .StartAt(new DateTimeOffset((new DateTime(2012, 11, 03))))
                        .EndAt(new DateTimeOffset(new DateTime(2012, 11, 10)))
                        .Build();
var xxx = TriggerUtils.ComputeFireTimesBetween(trigger as IOperableTriggernull, (new DateTime(2012, 11, 03)), new DateTime(2012, 11, 10));

and when you run it you should see something similar to (http://img4.imageshack.us/img4/2158/cron.png)

Funny thing is cron hour doesnt seem to matter. Is quartz actually going to fire task twice that day ? I was under impression something like this could only happen when my trigger fires around 2 am PST

Marko Lahma

unread,
Nov 12, 2012, 1:12:15 PM11/12/12
to Quartz. NET

This was indeed good detective work from Andrew and the fix is in master now. Will be part of 2.1.

-Marko


--
You received this message because you are subscribed to the Google Groups "Quartz.NET" group.
To view this discussion on the web visit https://groups.google.com/d/msg/quartznet/-/zXoKDY836XsJ.

To post to this group, send email to quar...@googlegroups.com.
To unsubscribe from this group, send email to quartznet+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/quartznet?hl=en.

Kristjan Laane

unread,
Oct 28, 2014, 5:17:00 AM10/28/14
to quar...@googlegroups.com
Hi!

This is still a bug with DailyTimeIntervalScheduleBuilder in the current NuGet release v 2.2.4
and I'm not sure how to fix it?

Here are the details of the incorrect double-event behaviour:

trigger created with, in GMT (London UK) timezone:
DailyTimeIntervalScheduleBuilder.Create()
                        .StartingDailyAt(TimeOfDay.HourAndMinuteOfDay(22, 15))
                        .OnEveryDay()
                        .WithIntervalInHours(24)
                        .WithRepeatCount(9999)
                        .InTimeZone(timeZoneInfo)

This Saturday 25th of October 2014 i.e. on last day when Daylight Saving Time (DST / Spring Forward) was still active, the trigger worked fine and triggered once at 22:15 local time.
On Sunday 26th at 0100 DST stopped and clocks where pushed back by 1 hour and standard time / Fall Back became active.
So the incorrect double trigger occured on Sunday 26th - first trigger occurred at 21:15 and second trigger occurred at 22:15 local time when only the second event should have occurred.
On Monday 27th of October all was fine again, the trigger occurred only once at 22:15 as scheduled.

Would really appreciate if someone knew how to fix it?

Thanks!

Marko Lahma

unread,
Nov 8, 2014, 4:13:03 AM11/8/14
to Quartz. NET
Thanks for the report. I've identified the issue to that proper offset
was not applied to calculated date, was using earlier fire time's
offset. I've fixed this now and the fix will be part of 2.3 release.

-Marko
> --
> You received this message because you are subscribed to the Google Groups
> "Quartz.NET" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to quartznet+...@googlegroups.com.
> To post to this group, send email to quar...@googlegroups.com.
> Visit this group at http://groups.google.com/group/quartznet.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages