CronTrigger misfire instruction DoNothing not working

804 views
Skip to first unread message

Krzysztof Zegzuła

unread,
Sep 15, 2015, 12:09:57 PM9/15/15
to Quartz.NET
Hello everyone
I encountered a problem with MisfireInstruction.CronTrigger.DoNothing (basicaly it is not working). My scenario:

I run my app at 10:00 pm, so my scheduler (and a listener) is initialized:
ISchedulerFactory schedFact = new StdSchedulerFactory();
sched = schedFact.GetScheduler();

listener = new MyListener(); 
sched.ListenerManager.AddSchedulerListener(listener);

Then I schedule some jobs using this code:
IJobDetail job = JobBuilder.Create<SwitchJob>()
   
.WithIdentity(jobName, "jobGroup")
   
.Build();

ITrigger trigger = TriggerBuilder.Create()
   
.WithIdentity(triggerName, "jobGroup")
   
.WithCronSchedule(cronPhrase, x => x
       
.WithMisfireHandlingInstructionDoNothing())
   
.UsingJobData("sourceId", sourceId)
   
.UsingJobData("transitionType", transitionType)
   
.ForJob(jobName, "jobGroup")
   
.Build();

sched
.ScheduleJob(job, trigger);

Some of the cronPhrases will say to execute for example everyday at 10:10 pm (so first execution would happen short time after being scheduled). 

Then at 10:20 pm I call
sched.Start();

And all misfired jobs that were scheduled and had their first execution time when Scheduler was in stand by, are triggered immediately even though they had the misfire policy set to MisfireInstruction.CronTrigger.DoNothing. According to the documentation they should not be fired untill the next time for example the next day 10:10 pm if the Scheduler was still on.

I researched on this topic and found peoples concerns about this unwanted behaviour even with the java implementation:

David Gràcia i Llobet

unread,
Sep 17, 2015, 8:12:55 AM9/17/15
to Quartz.NET
Hi,
We are having the same issue, it has the same behaviour as the MisfireInstructions.CronTrigger.IgnoreMisfirePolicy...
We haven't been able to successfully do this with a SimpleSchedule either...



El dimarts, 15 setembre de 2015 18:09:57 UTC+2, Krzysztof Zegzuła va escriure:
Reply all
Reply to author
Forward
0 new messages