1
votes

We have a Quartz.NET cron trigger setup that needs to execute a job using the following schedule:

At 02:00hrs in the merchants time zone daily

However, when Daylight Savings Time (DST) occurs abnormalities occur i.e:

  • When the merchants timezone moves from +2 GMT to +3 GMT, the job does not get executed.
  • When the merchants timezone moves from +3 GMT to +2 GMT, the job does gets executed twice.

We already know that this behaviour is by design (http://www.quartz-scheduler.net/faq.html#daylight) but what are people using as a solution to this DST issue?

Cheers

Billy Stack

3

3 Answers

1
votes

The link you point to may have been updated in the three years or so (!) since you asked this question. It would appear that the job should not be executed twice.

I'm unsure whether 02:00 officially 'occurs' in the US when daylight savings starts, so the concern about the job skipping execution at 02:00 could be resolved by setting it to 01:59:59 (cron trigger "59 59 1 ? *"), as long as you were in North America. Other countries may change at a different time of night. In Europe, for instance, the change is at 01:00, so there it would be better to set the trigger to 02:00:01

1
votes

Just experienced the same issue as well, although in my case the trigger was not scheduled to fire between 0:00 and the DST change time (2:00 in the US). Instead, I had a job that runs MON-FRI at 8 in the morning, so it ran twice on the Monday November the 5th, the day following the DST change day.

If you read the FAQ item linked to in the question, it kinda makes sense. The Cron trigger wakes up, fires the job, then calculates next time to wake up. When it woke up on Friday at 8am, it calculated next time to run as Monday at 8am. However, by Monday morning what used to be 8am became 7am, so the trigger fired at that time. And then when it ran, the next time was "correctly" calculated as 8am, so it ran again at that time also.

Hope this helps somebody struggling to understand the issue.

-1
votes

Jobs run twice in the fall and don't run at all in the spring. It doesn't matter what time they are scheduled. The question was and still is, "How do you stop this from happening?" If you manually delete all jobs after the time change and before they run then add them back then it works fine. I haven't looked at it yet but thinking this could be automated. Write something that reads all scheduled jobs and adds them and deletes the old records. Whatever you write would need to run from the Windows job scheduler because it wouldn't run at all in the spring if it ran from Quartz.