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-200

Scheduler#shutdown(false) waits for all currently executing jobs to complete

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 2 Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.1
    • Component/s: Core
    • Labels:
      None
    • Terracotta Target:
      Quartz 2.1.0
    • Fixed In Revision:
      1598,1599

      Description

      This occurs when using SimpleThreadPool.

      The run method in the WorkerThread class was changed from this in version 1.8.3:

           synchronized(this) {
               while (runnable == null && run) {
                   this.wait(500);
               }
           }
      
           if (runnable != null) {
               ran = true;
               runnable.run();
           }
      

      To this is version 2.0.2:

          synchronized(this) {
              while (runnable == null && run) {
                  this.wait(500);
              }
      
              if (runnable != null) {
                  ran = true;
                  runnable.run();
              }
          }
      

      So now the shutdown method in the WorkerThread class is blocked because is runs in a synchronized block, e.g.

              void shutdown() {
              	synchronized (this) {
              		run = false;
              	}
              }
      

      So effectively each worker thread must finish the task it is working on before the shutdown method can proceed to the next worker thread, which prevents Scheduler#shutdown(false) from exiting immediately.

        Attachments

          Activity

            People

            • Assignee:
              jhouse James House
              Reporter:
              mfrost Michael Frost
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: