Uploaded image for project: 'Quartz Scheduler (Historical - Do Not File New Issues Here - See GitHub)'
  1. Quartz Scheduler (Historical - Do Not File New Issues Here - See GitHub)
  2. QTZ-202

DisallowConcurrentExecution does not work as expected with batchTriggerAcquisitionMaxCount configuration

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 2 Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1, 2.0.2
    • Fix Version/s: 2.1
    • Labels:
      None
    • Terracotta Target:
      Quartz 2.1.0
    • Fixed In Revision:
      1628, 1645

      Description

      Hi,

      I am seeing issues with disallowconcurrentexecution when batchTriggerAcquisitionMaxCount is set to more than 1.

      We have Job class that have a repeating trigger and an occasional single trigger (to force the job) associated with it. Job class is annotated to disallow concurrent execution. Here is the scenario where multiple instances of job is running concurrently.

      1) Repeating trigger fires at its scheduled time. Lets name it RT1)
      2) Now one time trigger fires for same job but it gets blocked as expected (since it disallows concurrent execution) Lets name it as ST1
      3) Now job that is running due to RT1 is taking longer than repeat interval of repeating trigger
      4) So another repeating trigger fires (since repeat interval has elapsed) and it also gets blocked as expected (since it disallows concurrent execution). Lets name is RT2
      5) Now we have two triggers ST1 and RT2 that are blocked.
      6) Finally job that was running due to RT1 finishes.
      7) Now I see two instances of job running concurrently since ST1 and RT2 which were blocked gets fired at the same time which violates disallowconcurrentexecution.

      I confirmed I have the same job key. When I set batchTriggerAcquisitionMaxCount to 1, this problem does not happen.

      I am attaching simple example to reproduce this. I have run this example on both quartz-2.0.1 and 2.0.2 release.

      Output from the example clearly shows that job is running concurrently.


      1312556270276 Executing job due to trigger group1.RepeatingTrigger
      1312556285276 Finished Executing job due to trigger group1.RepeatingTrigger
      1312556285278 Executing job due to trigger group1.RepeatingTrigger
      1312556285278 Executing job due to trigger group1.OneTimeTrigger
      1312556300279 Finished Executing job due to trigger group1.RepeatingTrigger
      1312556300279 Finished Executing job due to trigger group1.OneTimeTrigger
      1312556300280 Executing job due to trigger group1.RepeatingTrigger
      1312556315280 Finished Executing job due to trigger group1.RepeatingTrigger
      1312556315281 Executing job due to trigger group1.RepeatingTrigger
      ------

      Please take a look. Also if there is any workaround without changing batchTriggerAcquisitionMaxCount config then we want to know.

      Thanks,
      -Chirag

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jhouse James House
                Reporter:
                chiragp chirag patel
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: