Question

I have a few questions regarding quartz.net.

What is it that keeps track of if there has been a missfire situation i Quartz.net?

What happens in the following scenarios:

If a job is run but cannot finnish due to some bug, does that count as a missfire or not?

What happens if i republish the solution, is the tracking reset?

Is there a way to receive information on what the scheduler has done and not been able to do?

I have the following code in my Run method:

IJobDetail dailyUserMailJob = new JobDetailImpl("DailyUserMailJob", null, typeof(Jobs.TestJob));


ITrigger trigger = TriggerBuilder.Create()
                    .WithIdentity("trigger1", "group1")


                    .WithCronSchedule("0 0 4 1 * ?", x => x.WithMisfireHandlingInstructionFireAndProceed())
                    .Build();

        this.Scheduler.ScheduleJob(dailyUserMailJob, trigger);

        this.Scheduler.Start();

The job is supposed to run the first every month on 4 am.

When testing I have set the system clock so that the jobb is missed for one month. According to the documentation when using WithMisfireHandlingInstructionFireAndProceed the job should be run the first thing that happens, but it dosent. Is there something wrong with the code or could it be some other reason the job is not run when using WithMisfireHandlingInstructionFireAndProceed() ?

Was it helpful?

Solution

If a job is missed, there is logic to bring it back. However, there is a "window" on how far back to go.

<add key="quartz.jobStore.misfireThreshold" value="60000"/>

You can increase this value.

If you have an ADOStore, misfires are persisted. Thus "if the power goes out", when restarting...you can recover from misfires.

If you have a RamStore...if "the power goes out", everything was in memory to begin with..so you won't get mis-fire handling, because everything was "in memory" and the memory is lost.

..

If you use Sql Server (AdoStore) and put a Profiler/Trace on it, you'll see the engine "poll" for misfires.......with a "go back this far in time" based on the misfireThreshold.

See this link:

http://nurkiewicz.blogspot.com/2012/04/quartz-scheduler-misfire-instructions.html

for more detailed info. Which has a "withMisfireHandlingInstructionFireAndProceed" note.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top