Commits

Anonymous committed 313c867

QUARTZ-13 - handle missed error case for thread pool

git-svn-id: http://svn.opensymphony.com/svn/quartz/trunk@59869f7d36a-ea1c-0410-88ea-9fd03e4c9665

  • Participants
  • Parent commits 15debf9

Comments (0)

Files changed (1)

File src/java/org/quartz/core/QuartzSchedulerThread.java

                                         trigger, bndle.getJobDetail(), Trigger.INSTRUCTION_SET_ALL_JOB_TRIGGERS_ERROR);
                             } catch (SchedulerException se2) {
                                 qs.notifySchedulerListenersError(
-                                        "An error occured while releasing trigger '"
+                                        "An error occured while placing job's triggers in error state '"
                                                 + trigger.getFullName() + "'", se2);
                                 // db connection must have failed... keep retrying
                                 // until it's up...
                             continue;
                         }
 
-                        qsRsrcs.getThreadPool().runInThread(shell);
+                        if (qsRsrcs.getThreadPool().runInThread(shell) == false) {
+                            try {
+                                // this case should never happen, as it is indicative of the
+                                // scheduler being shutdown or a bug in the thread pool or
+                                // a thread pool being used concurrently - which the docs
+                                // say not to do...
+                                qsRsrcs.getJobStore().triggeredJobComplete(ctxt,
+                                        trigger, bndle.getJobDetail(), Trigger.INSTRUCTION_SET_ALL_JOB_TRIGGERS_ERROR);
+                            } catch (SchedulerException se2) {
+                                qs.notifySchedulerListenersError(
+                                        "An error occured while placing job's triggers in error state '"
+                                                + trigger.getFullName() + "'", se2);
+                                // db connection must have failed... keep retrying
+                                // until it's up...
+                                releaseTriggerRetryLoop(trigger);
+                            }
+                        }
 
                         continue;
                     }