Issue Description
js.quartz.properties defines scheduler misfire policies for the trigger types. The concept of misfire is discussed here in this wiki and in our Admin guide > Configuring the Scheduler > Configuring the Scheduler Misfire Policy. All trigger types are set to SMART_POLICY, but it isn't obvious what SMART_POLICY is or what the other options mean.
Resolution
What is SMART_POLICY?
SMART_POLICY for repeating/simple triggers equates to MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT
SMART_POLICY for Calendar triggers equates to MISFIRE_INSTRUCTION_FIRE_ONCE_NOW
What are the possible POLICY options?
For single job:
#MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY #MISFIRE_INSTRUCTION_FIRE_NOW
For repeating simple job
#MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY #MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT #MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT #MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT #MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT
For Calendar/Cron job:
#MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY #MISFIRE_INSTRUCTION_FIRE_ONCE_NOW #MISFIRE_INSTRUCTION_DO_NOTHING
What are the POLICY meanings?
Definitions per quartz API:
#MISFIRE_INSTRUCTION_FIRE_NOW (default for single simple)
Instructs the Scheduler that upon a mis-fire situation, the SimpleTrigger wants to be fired now by Scheduler.
#MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY
Instructs the Scheduler that the Trigger will never be evaluated for a misfire situation, and that the scheduler will simply try to fire it as soon as it can, and then update the Trigger as if it had fired at the proper time.
NOTE: if a trigger uses this instruction, and it has missed several of its scheduled firings, then several rapid firings may occur as the trigger attempt to catch back up to where it would have been
#MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT (default for repeating simple)
Instructs the Scheduler that upon a mis-fire situation, the SimpleTrigger wants to be re-scheduled to the next scheduled time after 'now' - taking into account any associated Calendar, and with the repeat count set to what it would be, if it had not missed any firings. Does nothing, misfired executions are discarded. Then the scheduler waits for next scheduled interval and goes back to schedule.
#MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT
Instructs the Scheduler that upon a mis-fire situation, the SimpleTrigger wants to be re-scheduled to the next scheduled time after 'now' - taking into account any associated Calendar, and with the repeat count left unchanged.
#MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT
Instructs the Scheduler that upon a mis-fire situation, the SimpleTrigger wants to be re-scheduled to 'now' (even if the associated Calendar excludes 'now') with the repeat count left as-is. This does obey the Trigger end-time however, so if 'now' is after the end-time the Trigger will not fire again.
NOTE: Use of this instruction causes the trigger to 'forget' the start-time and repeat-count that it was originally setup with
#MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT
Instructs the Scheduler that upon a mis-fire situation, the SimpleTrigger wants to be re-scheduled to 'now' (even if the associated Calendar excludes 'now') with the repeat count set to what it would be, if it had not missed any firings. This does obey the Trigger end-time however, so if 'now' is after the end-time the Trigger will not fire again.
NOTE: Use of this instruction causes the trigger to 'forget' the start-time and repeat-count that it was originally setup with. Instead, the repeat count on the trigger will be changed to whatever the remaining repeat count is
#MISFIRE_INSTRUCTION_FIRE_ONCE_NOW (default for calendar/cron)
Instructs the Scheduler that upon a mis-fire situation, the CronTrigger wants to be fired now by Scheduler. Immediately executes first misfired execution and discards other (i.e. all misfired executions are merged together). Then back to schedule. No matter how many trigger executions were missed, only single immediate execution is performed.
#MISFIRE_INSTRUCTION_DO_NOTHING
Instructs the Scheduler that upon a mis-fire situation, the CronTrigger wants to have it's next-fire-time updated to the next time in the schedule after the current time (taking into account any associated Calendar), but it does not want to be fired now.
References:
Ref. Case 01457095
Recommended Comments
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now