quartz-scheduler

What does BLOCKED state mean for Quartz trigger


For some Quartz job, it misfired; and after checked the trigger status in database, it shows BLOCKED. What does this BLOCKED mean specifically?


Solution

  • WAITING = the normal state of a trigger, waiting for its fire time to arrive and be acquired for firing by a scheduler.

    PAUSED = means that one of the scheduler.pauseXXX() methods was used. The trigger is not eligible for being fired until it is resumed.

    ACQUIRED = a scheduler node has identified this trigger as the next trigger it will fire - may still be waiting for its fire time to arrive. After it fires the trigger will be updated (per its repeat settings, if any) and placed back into the WAITING state (or be deleted if it does not repeat again).

    BLOCKED = the trigger is prevented from being fired because it relates to a StatefulJob that is already executing. When the statefuljob completes its execution, all triggers relating to that job will return to the WAITING state.

    In other words, When a state is BLOCKED, another trigger (or an instance of this trigger) is already executing for the trigger's stateful job, so this trigger is blocked until the other trigger is finished.

    Link to documentation could be useful for your future reference.http://www.docjar.com/docs/api/org/quartz/Trigger.html