Note that there are some explanatory texts on larger screens.

plurals
  1. POQuartz Scheduler running missing triggers even if misfire instruction is set
    primarykey
    data
    text
    <p>I am having trouble with Quartz Scheduler. To be practical here you find my code of unit test:</p> <pre><code>Scheduler scheduler = new StdSchedulerFactory().getScheduler(); scheduler.getListenerManager().addSchedulerListener(schedulerTestListener); Trigger trigger = newTrigger() .withIdentity(CoreTestConstants.TEST_TRIGGER, CoreTestConstants.TEST_TRIGGER_GROUP) .withSchedule(simpleSchedule() .withMisfireHandlingInstructionIgnoreMisfires() .withIntervalInMilliseconds(1000) .repeatForever()) .forJob(CoreTestConstants.TEST_JOB, CoreTestConstants.TEST_JOB_GROUP) .build(); scheduler.scheduleJob(getJobDetail(), trigger); Thread.sleep(20000L); scheduler.start(); </code></pre> <hr> <p>The problem is, when the scheduler.scheduleJob(...) is executed I recognize that the task is not immediately started however when the scheduler.start() is executed I see that the 20 tasks is being executed immediately.</p> <p>I mean, normally to my mind tasks should not be recorded or start until scheduler.start() is executed. But somehow the quartz system holds the state of tasks even before scheduler.start() is not executed, then when scheduler.start() call the missing task executions is triggered immediately.</p> <p>Here the log:</p> <pre><code>09:32:45,005 INFO StdSchedulerFactory:1310 - Quartz scheduler version: 2.1.5 09:32:51,013 INFO SchedulerTest:47 - [test] Scheduler starting.. 09:32:51,014 INFO QuartzScheduler:534 - Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started. *** [TIMER-TEST] 2012-10-10 09:32:51 / Test task is executed. Count: 1 / 1349850771037 *** [TIMER-TEST] 2012-10-10 09:32:51 / Test task is executed. Count: 2 / 1349850771040 *** [TIMER-TEST] 2012-10-10 09:32:51 / Test task is executed. Count: 3 / 1349850771040 *** [TIMER-TEST] 2012-10-10 09:32:51 / Test task is executed. Count: 4 / 1349850771041 *** [TIMER-TEST] 2012-10-10 09:32:51 / Test task is executed. Count: 5 / 1349850771042 *** [TIMER-TEST] 2012-10-10 09:32:51 / Test task is executed. Count: 6 / 1349850771043 *** [TIMER-TEST] 2012-10-10 09:32:51 / Test task is executed. Count: 7 / 1349850771044 </code></pre> <p>As you can see even if I set the trigger to execute with interval in 1 seconds, it executed the missing tasks during thread sleep. </p> <p>I tried to play around misfire instructions but it doesnt make a sense, it does not change the behaviour of the code in my case.</p> <p>Any help would be appreciated. Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload