Quartz Scheduler
  1. Quartz Scheduler
  2. QTZ-283

MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY not working with JDBCJobStore

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: 2 Major 2 Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.3
    • Fix Version/s: 2.1.4
    • Component/s: None
    • Labels:
      None
    • Terracotta Target:
      Quartz 2.1.4
    • Fixed In Revision:
      1988

      Description

      According to MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY documentation "the scheduler will simply try to fire [the trigger] as soon as it can". It works as expected with RAMJobStore.

      However with JDBCJobStore nothing happens. Triggers with next scheduled time way in the past are simply ignored for good. Seems like the SQL query is purposely written to ignore triggers with MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY (-1):

      SELECT COUNT(TRIGGER_NAME)
      FROM TRIGGERS WHERE SCHED_NAME = 'schedulerFactory'
      AND NOT (MISFIRE_INSTR = -1)  --here's the problem
      AND NEXT_FIRE_TIME < 1333727366734
      AND TRIGGER_STATE = 'WAITING'

      If this is not a bug (?!?), why RAM job store works as described?

        Activity

        Hide
        James House added a comment - - edited

        Yes, this looks like a bug indeed - but not with the specific query you point out. The query for handing misfires does purposely ignore those triggers with the misfire_instruction of ignore (-1). However I think the acquire trigger query (StdJDBCConstants.SELECT_NEXT_TRIGGER_TO_ACQUIRE) is probably ignoring triggers far in the past (further back than the misfire threshold), and therein lies the bug.

        Show
        James House added a comment - - edited Yes, this looks like a bug indeed - but not with the specific query you point out. The query for handing misfires does purposely ignore those triggers with the misfire_instruction of ignore (-1). However I think the acquire trigger query (StdJDBCConstants.SELECT_NEXT_TRIGGER_TO_ACQUIRE) is probably ignoring triggers far in the past (further back than the misfire threshold), and therein lies the bug.
        Hide
        Anthony Dahanne added a comment -

        solution : when acquiring the next trigger, if misfire instruction=-1 (ignore policy) we do not check how old is the trigger next fire time

        Show
        Anthony Dahanne added a comment - solution : when acquiring the next trigger, if misfire instruction=-1 (ignore policy) we do not check how old is the trigger next fire time

          People

          • Assignee:
            Anthony Dahanne
            Reporter:
            Tomasz Nurkiewicz
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: