What is the difference between scheduler's standby() and pauseAll()?
Asked Answered
H

5

19

I'm using Quartz Scheduler v.1.8.0.

What's the difference between scheduler.standby() and scheduler.pauseAll()?

standby() - Temporarily halts the Scheduler's firing of Triggers.

pauseAll() - Pause all triggers - similar to calling pauseTriggerGroup(group) on every group, however, after using this method resumeAll() must be called to clear the scheduler's state of 'remembering' that all new triggers will be paused as they are added.

Based on what I've understood from the API documentation, I'm not able to easily/clearly differentiate/distinguish from each one of them. I'm seeing both of them serving the same purpose - temporarily pause/halt all the triggers in the scheduler, and subsequently followed by a start() (for standby) or resumeAll() (for pauseAll) to clear the scheduler's state. Is there any other difference?

Hope experts can help me in understanding any subtle difference.

Headwards answered 6/9, 2010 at 9:57 Comment(0)
L
17

The difference is in trigger misfire instructions applying behavior.

When you call start() after standby(), any misfires, which appear while standby, will be ignored.

When you call resumeAll() after pauseAll(), all misfires, which appear while scheduler was paused, will be applyed.

Lw answered 6/9, 2010 at 11:15 Comment(1)
This is incorrect. if you call standby() and then start(), the trigger mis-fires will be ignored only during execution of start(), and not work the whole duration between call to standby() and start().Luster
Z
7

There is difference when scheduler is resumed after standby and pauseAll.

I have made difference in bold in following description from API docs.

standby :

void standby() throws SchedulerException Temporarily halts the Scheduler's firing of Triggers.

When start() is called (to bring the scheduler out of stand-by mode), trigger misfire instructions will NOT be applied during the execution of the start() method - any misfires will be detected immediately afterward (by the JobStore's normal process).

The scheduler is not destroyed, and can be re-started at any time.

pauseAll :

void pauseAll() throws SchedulerException Pause all triggers - similar to calling pauseTriggerGroup(group) on every group, however, after using this method resumeAll() must be called to clear the scheduler's state of 'remembering' that all new triggers will be paused as they are added.

When resumeAll() is called (to un-pause), trigger misfire instructions WILL be applied.

Zoosporangium answered 6/9, 2010 at 11:16 Comment(0)
M
4

Here are what I got from source code v1.8.6:

standby() simply freezes the scheduler thread, which means no more trigger will be fired from now on, even those new triggers added later.

start() just resume the scheduler thread, and will not apply misfire policies immediately. But all misfires will be applied later naturally.

pauseAll() is similar to call pauseTriggerGroup() on every now existing trigger groups, which means those new trigger groups added later will be fired normally. And please notice that there is nothing to do with pauseJob() or pauseJobGroup(), it's just about what happening on triggers and their groups.

resumeAll() is similar to call resumeTriggerGroup() on every now existing trigger groups. In addition, misfires will be applied during execution of resumeAll().

Macbeth answered 3/7, 2018 at 13:20 Comment(0)
L
0

start() and standby() are per-instance methods. Other instances running in clustered mode will continue to trigger jobs.

resumeAll() and pauseAll() is applicable to the whole cluster.

Luster answered 18/3, 2016 at 0:4 Comment(0)
E
0

While pauseAll() pauses all schedules (already created by that moment), standby() pauses a scheduler itself. Thus when you create a new schedule, after pauseAll() it will be scheduled and run appropriately, but in case of standby() it runs not earlier than a 'start()' method will be called on a scheduler.

Ezekiel answered 29/10, 2017 at 17:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.